mirror of
https://github.com/google/comprehensive-rust.git
synced 2024-11-24 17:06:37 +02:00
Fix “incorrect” which should have been “unsafe” (#2419)
This commit is contained in:
parent
701589ffd5
commit
0c824ab740
@ -79,8 +79,8 @@ fn main() {
|
|||||||
## Calling Unsafe Functions
|
## Calling Unsafe Functions
|
||||||
|
|
||||||
`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can
|
`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can
|
||||||
create UB if the range is incorrect. `abs` is incorrect for a different reason:
|
create UB if the range is incorrect. `abs` is unsafe for a different reason: it
|
||||||
it is an external function (FFI). Calling external functions is usually only a
|
is an external function (FFI). Calling external functions is usually only a
|
||||||
problem when those functions do things with pointers which might violate Rust's
|
problem when those functions do things with pointers which might violate Rust's
|
||||||
memory model, but in general any C function might have undefined behaviour under
|
memory model, but in general any C function might have undefined behaviour under
|
||||||
any arbitrary circumstances.
|
any arbitrary circumstances.
|
||||||
|
Loading…
Reference in New Issue
Block a user