Skip to content

Commit d390ce2

Browse files
committed
mention the extra const UB
1 parent 578fd2e commit d390ce2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/behavior-considered-undefined.md

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ code.
6060
> `rustc_layout_scalar_valid_range_*` attributes.
6161
* Incorrect use of inline assembly. For more details, refer to the [rules] to
6262
follow when writing code that uses inline assembly.
63+
* **In `const` context** (i.e., during the evaluation of a `const`/`static`
64+
initializer, array length, enum discriminant, or const generic value):
65+
transmuting or otherwise reinterpreting a pointer into some allocated object
66+
as an integer.
6367

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

0 commit comments

Comments
 (0)