Skip to content

Commit e94fb3d

Browse files
authored
Merge pull request #1273 from RalfJung/const-ub
mention the extra const UB
2 parents 5377523 + 32caa7d commit e94fb3d

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
@@ -74,6 +74,11 @@ code.
7474
> `rustc_layout_scalar_valid_range_*` attributes.
7575
* Incorrect use of inline assembly. For more details, refer to the [rules] to
7676
follow when writing code that uses inline assembly.
77+
* **In [const context](const_eval.md#const-context)**: transmuting or otherwise
78+
reinterpreting a pointer (reference, raw pointer, or function pointer) into
79+
some allocated object as a non-pointer type (such as integers).
80+
'Reinterpreting' refers to loading the pointer value at integer type without a
81+
cast, e.g. by doing raw pointer casts or using a union.
7782

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

0 commit comments

Comments
 (0)