Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
move libstd concerns out of the rustc note
  • Loading branch information
RalfJung committed Aug 27, 2019
commit f10ed4b986c6b05bdb5b341ad321bb1ad8736e4f
5 changes: 3 additions & 2 deletions src/behavior-considered-undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ code.
(i.e., it must not be read from uninitialized memory).
* Non-UTF-8 byte sequences in a `str`.
* Invalid values for a type with a custom definition of invalid values.
In the standard library, this affects [`NonNull<T>`] and [`NonZero*`].

> **Note**: For `rustc`, those types are [`NonNull<T>`] and [`NonZero*`].
> Requesting custom invalid values requires the unstable `rustc_layout_scalar_valid_range_*` attributes.
> **Note**: For `rustc`, requesting custom invalid values requires the
> unstable `rustc_layout_scalar_valid_range_*` attributes.

A reference/pointer is "dangling" if it is null or not all of the bytes it
points to are part of the same allocation (so in particular they all have to be
Expand Down