Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust for current reality wrt. wide raw pointers #162

Merged
merged 10 commits into from
Sep 12, 2019
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:
RalfJung marked this conversation as resolved.
Show resolved Hide resolved
* 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