Skip to content

UB: update the extra clause for provenance UB during const evaluation - #2091

Merged
traviscross merged 6 commits into
rust-lang:masterfrom
RalfJung:const-eval-provenance-ub
Dec 9, 2025
Merged

traviscross merged 6 commits into
rust-lang:masterfrom
RalfJung:const-eval-provenance-ub

Conversation

@RalfJung

Copy link
Copy Markdown
Member

The old note didn't make it clear that the transmute is also illegal when it occurs nested inside a field. We already have the framework of "valid values" for this, so let's just use that also for this extra restriction.

Furthermore, there's another way to cause UB with provenance during const evaluation: by having a pointer whose bytes are mixed up.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants