Skip to content

Commit af33b30

Browse files
author
Andrew Brinker
committed
Fixed based on feedback from steveklabnik
1 parent 00e77d7 commit af33b30

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/doc/nomicon/safe-unsafe-meaning.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ What's the relationship between Safe Rust and Unsafe Rust? How do they
44
interact?
55

66
The separation between Safe Rust and Unsafe Rust is controlled with the
7-
`unsafe` keyword, which acts as a sort of *foreign function interface*
8-
from one to the other. This boundary is why we can say Safe Rust is a
9-
safe language: all the unsafe parts are kept exclusively behind the FFI
10-
boundary, *just like any other safe language*. Best of all, because Safe
11-
Rust is a subset of Unsafe Rust, the two can be cleanly intermixed,
12-
without headers, runtimes, or any other FFI boilerplate.
13-
14-
The `unsafe` keyword has dual purposes: to declare the existence of
15-
contracts the compiler can't check, and to declare that the adherence
16-
of some code to those contracts has been checked by the programmer,
17-
and the code can therefore be trusted.
7+
`unsafe` keyword, which acts as an interface from one to the other. This is
8+
why we can say Safe Rust is a safe language: all the unsafe parts are kept
9+
exclusively behind the boundary.
10+
11+
The `unsafe` keyword has two uses: to declare the existence of contracts the
12+
compiler can't check, and to declare that the adherence of some code to
13+
those contracts has been checked by the programmer.
1814

1915
You can use `unsafe` to indicate the existence of unchecked contracts on
2016
_functions_ and on _trait declarations_. On functions, `unsafe` means that

0 commit comments

Comments
 (0)