Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/what-unsafe-does.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ to your program. You definitely *should not* invoke Undefined Behavior.
Unlike C, Undefined Behavior is pretty limited in scope in Rust. All the core
language cares about is preventing the following things:

* Dereferencing (using the `*` operator on) dangling, or unaligned pointers, or
wide pointers with invalid metadata (see below)
* Dereferencing (using the `*` operator on) dangling or unaligned pointers (see below)
* Breaking the [pointer aliasing rules][]
* Unwinding into another language
* Causing a [data race][race]
Expand All @@ -30,8 +29,8 @@ language cares about is preventing the following things:
* a null `fn` pointer
* a `char` outside the ranges [0x0, 0xD7FF] and [0xE000, 0x10FFFF]
* a `!` (all values are invalid for this type)
* a reference that is dangling, unaligned, points to an invalid value, or
that has invalid metadata (if wide)
* a reference/`Box` that is dangling, unaligned, or points to an invalid value.
* a wide reference, `Box` or raw pointer that has invalid metadata:
* slice metadata is invalid if the slice has a total size larger than
`isize::MAX` bytes in memory
* `dyn Trait` metadata is invalid if it is not a pointer to a vtable for
Expand Down