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