@@ -1117,13 +1117,13 @@ Rust:
1117
1117
##### Unsafe functions
1118
1118
1119
1119
Unsafe functions are functions that are not safe in all contexts and/or for all
1120
- possible inputs. Such a function must be prefixed with the keyword ` unsafe ` .
1120
+ possible inputs. Such a function must be prefixed with the keyword ` unsafe ` and
1121
+ can only be called from an ` unsafe ` block or another ` unsafe ` function.
1121
1122
1122
1123
##### Unsafe blocks
1123
1124
1124
- A block of code can also be prefixed with the ` unsafe ` keyword, to permit
1125
- calling ` unsafe ` functions or dereferencing raw pointers within a safe
1126
- function.
1125
+ A block of code can be prefixed with the ` unsafe ` keyword, to permit calling
1126
+ ` unsafe ` functions or dereferencing raw pointers within a safe function.
1127
1127
1128
1128
When a programmer has sufficient conviction that a sequence of potentially
1129
1129
unsafe operations is actually safe, they can encapsulate that sequence (taken
@@ -1143,12 +1143,11 @@ represented with reference-counted pointers in safe code. By using `unsafe`
1143
1143
blocks to represent the reverse links as raw pointers, it can be implemented
1144
1144
with only boxes.
1145
1145
1146
- ##### Behavior considered unsafe
1146
+ ##### Behavior considered undefined
1147
1147
1148
- This is a list of behavior which is forbidden in all Rust code. Type checking
1149
- provides the guarantee that these issues are never caused by safe code. An
1150
- ` unsafe ` block or function is responsible for never invoking this behaviour or
1151
- exposing an API making it possible for it to occur in safe code.
1148
+ The following is a list of behavior which is forbidden in all Rust code,
1149
+ including within ` unsafe ` blocks and ` unsafe ` functions. Type checking provides
1150
+ the guarantee that these issues are never caused by safe code.
1152
1151
1153
1152
* Data races
1154
1153
* Dereferencing a null/dangling raw pointer
0 commit comments