Skip to content

Commit 3724dab

Browse files
committed
sound and unsound
1 parent 1528956 commit 3724dab

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/behavior-considered-undefined.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
## Behavior considered undefined
22

3-
Rust code, including within `unsafe` blocks and `unsafe` functions is incorrect
4-
if it exhibits any of the behaviors in the following list. It is the
5-
programmer's responsibility when writing `unsafe` code that it is not possible
6-
to let `safe` code exhibit these behaviors.
3+
Rust code is incorrect if it exhibits any of the behaviors in the following
4+
list. This includes code within `unsafe` blocks and `unsafe` functions!
5+
`unsafe` is not an excuse to cause undefined behavior.
6+
7+
It is the programmer's responsibility when writing `unsafe` code that it is not
8+
possible to let `safe` code exhibit these behaviors. `unsafe` code that
9+
satisfies this property for any `safe` client is called *sound*; if `unsafe`
10+
code can be misused by `safe` code to exhibit undefined behavior, it is
11+
*unsound*.
712

813
<div class="warning">
914

0 commit comments

Comments
 (0)