Skip to content

Commit 5665efd

Browse files
committed
Rollup merge of #27201 - Ticki:master, r=steveklabnik
Just some small changes.
2 parents 7cacf83 + cf1e078 commit 5665efd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/doc/trpl/ffi.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ libraries:
340340
Note that frameworks are only available on OSX targets.
341341
342342
The different `kind` values are meant to differentiate how the native library
343-
participates in linkage. From a linkage perspective, the rust compiler creates
343+
participates in linkage. From a linkage perspective, the Rust compiler creates
344344
two flavors of artifacts: partial (rlib/staticlib) and final (dylib/binary).
345345
Native dynamic library and framework dependencies are propagated to the final
346346
artifact boundary, while static library dependencies are not propagated at
@@ -350,9 +350,9 @@ artifact.
350350
A few examples of how this model can be used are:
351351
352352
* A native build dependency. Sometimes some C/C++ glue is needed when writing
353-
some rust code, but distribution of the C/C++ code in a library format is just
353+
some Rust code, but distribution of the C/C++ code in a library format is just
354354
a burden. In this case, the code will be archived into `libfoo.a` and then the
355-
rust crate would declare a dependency via `#[link(name = "foo", kind =
355+
Rust crate would declare a dependency via `#[link(name = "foo", kind =
356356
"static")]`.
357357
358358
Regardless of the flavor of output for the crate, the native static library
@@ -361,7 +361,7 @@ A few examples of how this model can be used are:
361361
362362
* A normal dynamic dependency. Common system libraries (like `readline`) are
363363
available on a large number of systems, and often a static copy of these
364-
libraries cannot be found. When this dependency is included in a rust crate,
364+
libraries cannot be found. When this dependency is included in a Rust crate,
365365
partial targets (like rlibs) will not link to the library, but when the rlib
366366
is included in a final target (like a binary), the native library will be
367367
linked in.

src/doc/trpl/unsafe.md

+7-3
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)