diff --git a/ci/dictionary.txt b/ci/dictionary.txt index 9f305940c0..a7fcac4afc 100644 --- a/ci/dictionary.txt +++ b/ci/dictionary.txt @@ -2,6 +2,7 @@ personal_ws-1.1 en 0 utf-8 abcabcabc abcd abcdefghijklmnopqrstuvwxyz +ABIs AddAssign Addr adfb diff --git a/src/ch20-01-unsafe-rust.md b/src/ch20-01-unsafe-rust.md index 8796483a4b..56e1952b78 100644 --- a/src/ch20-01-unsafe-rust.md +++ b/src/ch20-01-unsafe-rust.md @@ -333,7 +333,8 @@ Within the `unsafe extern "C"` block, we list the names and signatures of external functions from another language we want to call. The `"C"` part defines which _application binary interface (ABI)_ the external function uses: the ABI defines how to call the function at the assembly level. The `"C"` ABI is the -most common and follows the C programming language’s ABI. +most common and follows the C programming language’s ABI. Information about all +the ABIs Rust supports is available in [the Rust Reference][ABI]. This particular function does not have any memory safety considerations, though. 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 used in a particular instance at one time. Unions are primarily used to interface with unions in C code. Accessing union fields is unsafe because Rust can’t guarantee the type of the data currently being stored in the union -instance. You can learn more about unions in [the Rust Reference][reference]. +instance. You can learn more about unions in [the Rust Reference][unions]. ### Using Miri to check unsafe code @@ -535,9 +536,10 @@ Whenever you write unsafe code, you can use Miri to help you be more confident that the code you have written upholds Rust’s rules. [dangling-references]: ch04-02-references-and-borrowing.html#dangling-references +[ABI]: ../reference/items/external-blocks.html#abi [differences-between-variables-and-constants]: ch03-01-variables-and-mutability.html#constants [extensible-concurrency-with-the-sync-and-send-traits]: ch16-04-extensible-concurrency-sync-and-send.html#extensible-concurrency-with-the-sync-and-send-traits [the-slice-type]: ch04-03-slices.html#the-slice-type -[reference]: ../reference/items/unions.html +[unions]: ../reference/items/unions.html [miri]: https://github.com/rust-lang/miri [nightly]: appendix-07-nightly-rust.html