Skip to content

Commit 32caa7d

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

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/behavior-considered-undefined.md

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ 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](const_eval.md#const-context)**: transmuting or otherwise
64+
reinterpreting a pointer (reference, raw pointer, or function pointer) into
65+
some allocated object as a non-pointer type (such as integers).
66+
'Reinterpreting' refers to loading the pointer value at integer type without a
67+
cast, e.g. by doing raw pointer casts or using a union.
6368

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

0 commit comments

Comments
 (0)