Skip to content

Commit 6d746fe

Browse files
committed
---
yaml --- r: 160315 b: refs/heads/master c: b825b34 h: refs/heads/master i: 160313: 73b0188 160311: c9ba97a v: v3
1 parent aadc3e3 commit 6d746fe

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c287afb2fa530d22563391737ac1d44faf2f9b2e
2+
refs/heads/master: b825b3496aff1ed784f7a7ca935245208b95aabb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 96c8f2b0c1846756e617f1f1fc1372c506e24248
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe

trunk/src/doc/reference.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,13 +1114,13 @@ Rust:
11141114
##### Unsafe functions
11151115

11161116
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.
11181119

11191120
##### Unsafe blocks
11201121

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.
11241124

11251125
When a programmer has sufficient conviction that a sequence of potentially
11261126
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`
11401140
blocks to represent the reverse links as raw pointers, it can be implemented
11411141
with only boxes.
11421142

1143-
##### Behavior considered unsafe
1143+
##### Behavior considered undefined
11441144

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.
11491148

11501149
* Data races
11511150
* Dereferencing a null/dangling raw pointer

0 commit comments

Comments
 (0)