1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-07-01 20:54:31 +02:00

fix: typo in "unsafe external functions" (#2724)

This commit is contained in:
Nabeelimran
2025-04-26 20:37:10 +05:00
committed by GitHub
parent 059e75b47c
commit d6fbd215a1

View File

@ -33,9 +33,9 @@ fn main() {
1.82 with `unsafe extern` blocks. 1.82 with `unsafe extern` blocks.
- `abs` must be explicitly marked as `safe` because it is an external function - `abs` must be explicitly marked as `safe` because it is an external function
(FFI). Calling external functions is usually only a problem when those (FFI). Calling external functions is usually only a problem when those
functions do things with pointers which which might violate Rust's memory functions do things with pointers which might violate Rust's memory model, but
model, but in general any C function might have undefined behaviour under any in general any C function might have undefined behaviour under any arbitrary
arbitrary circumstances. circumstances.
- The `"C"` in this example is the ABI; - The `"C"` in this example is the ABI;
[other ABIs are available too](https://doc.rust-lang.org/reference/items/external-blocks.html). [other ABIs are available too](https://doc.rust-lang.org/reference/items/external-blocks.html).
- Note that there is no verification that the Rust function signature matches - Note that there is no verification that the Rust function signature matches