-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Extend the enum check to pointer and union reads #144353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
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