Skip to content

Commit 415d5c7

Browse files
committed
Ch. 20: tell folks to see the Reference for more ABI info
1 parent ad2011d commit 415d5c7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ci/dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ personal_ws-1.1 en 0 utf-8
22
abcabcabc
33
abcd
44
abcdefghijklmnopqrstuvwxyz
5+
ABIs
56
AddAssign
67
Addr
78
adfb

src/ch20-01-unsafe-rust.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ Within the `unsafe extern "C"` block, we list the names and signatures of
333333
external functions from another language we want to call. The `"C"` part defines
334334
which _application binary interface (ABI)_ the external function uses: the ABI
335335
defines how to call the function at the assembly level. The `"C"` ABI is the
336-
most common and follows the C programming language’s ABI.
336+
most common and follows the C programming language’s ABI. Information about all
337+
the ABIs Rust supports is available in [the Rust Reference][ABI].
337338

338339
This particular function does not have any memory safety considerations, though.
339340
In fact, we know that any call to `abs` will always be safe for any `i32`, so we
@@ -481,7 +482,7 @@ _union_. A `union` is similar to a `struct`, but only one declared field is
481482
used in a particular instance at one time. Unions are primarily used to
482483
interface with unions in C code. Accessing union fields is unsafe because Rust
483484
cant guarantee the type of the data currently being stored in the union
484-
instance. You can learn more about unions in [the Rust Reference][reference].
485+
instance. You can learn more about unions in [the Rust Reference][unions].
485486
486487
### Using Miri to check unsafe code
487488
@@ -535,9 +536,10 @@ Whenever you write unsafe code, you can use Miri to help you be more confident
535536
that the code you have written upholds Rust’s rules.
536537
537538
[dangling-references]: ch04-02-references-and-borrowing.html#dangling-references
539+
[ABI]: ../reference/items/external-blocks.html#abi
538540
[differences-between-variables-and-constants]: ch03-01-variables-and-mutability.html#constants
539541
[extensible-concurrency-with-the-sync-and-send-traits]: ch16-04-extensible-concurrency-sync-and-send.html#extensible-concurrency-with-the-sync-and-send-traits
540542
[the-slice-type]: ch04-03-slices.html#the-slice-type
541-
[reference]: ../reference/items/unions.html
543+
[unions]: ../reference/items/unions.html
542544
[miri]: https://github.com/rust-lang/miri
543545
[nightly]: appendix-07-nightly-rust.html

0 commit comments

Comments
 (0)