@@ -4,17 +4,13 @@ What's the relationship between Safe Rust and Unsafe Rust? How do they
4
4
interact?
5
5
6
6
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.
18
14
19
15
You can use ` unsafe ` to indicate the existence of unchecked contracts on
20
16
_ functions_ and on _ trait declarations_ . On functions, ` unsafe ` means that
0 commit comments