Extend the enum check to pointer and union reads#144353
Extend the enum check to pointer and union reads#1443531c3t3a wants to merge 2 commits intorust-lang:mainfrom
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This comment has been minimized.
This comment has been minimized.
ccd9d59 to
ec30c0d
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
ec30c0d to
852275f
Compare
This comment has been minimized.
This comment has been minimized.
852275f to
aeaa360
Compare
This comment has been minimized.
This comment has been minimized.
aeaa360 to
34076b4
Compare
This comment has been minimized.
This comment has been minimized.
34076b4 to
1db3517
Compare
This comment has been minimized.
This comment has been minimized.
e9cba62 to
8ae0303
Compare
This comment has been minimized.
This comment has been minimized.
|
CI doesn't pass, so I'm setting this to waiting on author. If that's wrong and you want help with getting CI to pass, give a shout. |
8ae0303 to
bae1afd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This change extends the previously added enum discriminant check to enums read through a union or pointer. At the moment we only insert the check when transmuting to an enum. Although I hoped for it, this check isn't yet inserted for calls to `MaybeUninit::assume_init`, because the pass is running on polymorphic MIR and thus doesn't have the information yet to know whether the type that is read is an enum.
bae1afd to
a969bf9
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
557081f to
5bf5a01
Compare
This comment has been minimized.
This comment has been minimized.
5bf5a01 to
e167550
Compare
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
This comment has been minimized.
This comment has been minimized.
e167550 to
e6f5eb3
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
☔ The latest upstream changes (presumably #152163) made this pull request unmergeable. Please resolve the merge conflicts. |
This change extends the previously added enum discriminant check to enums read through a union or pointer. At the moment we only insert the check when transmuting to an enum. Although I hoped for it, this check isn't yet inserted for calls to
MaybeUninit::assume_init, because the pass is running on polymorphic MIR and thus doesn't have the information yet to know whether the type that is read is an enum.This is related to #143087.
r? @saethlin