Skip to content

Commit a5c7b96

Browse files
author
Ticki
committed
Add info about usage of 'unsafe' keyword in bindings to foreign interfaces.
1 parent 5dbddfb commit a5c7b96

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/doc/trpl/unsafe.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ that you normally can not do. Just three. Here they are:
100100

101101
That’s it. It’s important that `unsafe` does not, for example, ‘turn off the
102102
borrow checker’. Adding `unsafe` to some random Rust code doesn’t change its
103-
semantics, it won’t just start accepting anything.
103+
semantics, it won’t just start accepting anything. But it will let you write
104+
things that _do_ break some of the rules.
104105

105-
But it will let you write things that _do_ break some of the rules. Let’s go
106-
over these three abilities in order.
106+
You will also encounter the 'unsafe' keyword when writing bindings to foreign
107+
(non-Rust) interfaces. You're encouraged to write a safe, native Rust interface
108+
around the methods provided by the library.
109+
110+
Let’s go over the basic three abilities listed, in order.
107111

108112
## Access or update a `static mut`
109113

0 commit comments

Comments
 (0)