File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 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 ` only means that avoiding undefined behavior is on the programmer; it
6+ does not change anything about the fact that Rust programs must never cause
7+ undefined behavior.
8+
9+ It is the programmer's responsibility when writing ` unsafe ` code to ensure that
10+ any safe code interacting with the ` unsafe ` code cannot trigger these
11+ behaviors. ` unsafe ` code that satisfies this property for any safe client is
12+ called * sound* ; if ` unsafe ` code can be misused by safe code to exhibit
13+ undefined behavior, it is * unsound* .
714
815<div class =" warning " >
916
You can’t perform that action at this time.
0 commit comments