Skip to content

Commit

Permalink
Fixed based on feedback from steveklabnik
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Brinker committed Jun 7, 2016
1 parent 00e77d7 commit af33b30
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/doc/nomicon/safe-unsafe-meaning.md
Expand Up @@ -4,17 +4,13 @@ What's the relationship between Safe Rust and Unsafe Rust? How do they
interact?

The separation between Safe Rust and Unsafe Rust is controlled with the
`unsafe` keyword, which acts as a sort of *foreign function interface*
from one to the other. This boundary is why we can say Safe Rust is a
safe language: all the unsafe parts are kept exclusively behind the FFI
boundary, *just like any other safe language*. Best of all, because Safe
Rust is a subset of Unsafe Rust, the two can be cleanly intermixed,
without headers, runtimes, or any other FFI boilerplate.

The `unsafe` keyword has dual purposes: to declare the existence of
contracts the compiler can't check, and to declare that the adherence
of some code to those contracts has been checked by the programmer,
and the code can therefore be trusted.
`unsafe` keyword, which acts as an interface from one to the other. This is
why we can say Safe Rust is a safe language: all the unsafe parts are kept
exclusively behind the boundary.

The `unsafe` keyword has two uses: to declare the existence of contracts the
compiler can't check, and to declare that the adherence of some code to
those contracts has been checked by the programmer.

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

0 comments on commit af33b30

Please sign in to comment.