Skip to content

Commit

Permalink
mention the extra const UB
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 25, 2022
1 parent 578fd2e commit 8bbe676
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/behavior-considered-undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ code.
> `rustc_layout_scalar_valid_range_*` attributes.
* Incorrect use of inline assembly. For more details, refer to the [rules] to
follow when writing code that uses inline assembly.
* **In `const` context** (i.e., during the evaluation of a `const`/`static`
initializer, array length, enum discriminant, or const generic value):
transmuting or otherwise reinterpreting a pointer into some allocated object
as an integer or other non-pointer type.

**Note:** Uninitialized memory is also implicitly invalid for any type that has
a restricted set of valid values. In other words, the only cases in which
Expand Down

0 comments on commit 8bbe676

Please sign in to comment.