-
Notifications
You must be signed in to change notification settings - Fork 14k
Fix ICE for repr simd on non struct #148638
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: master
Are you sure you want to change the base?
Fix ICE for repr simd on non struct #148638
Conversation
|
r=me when ci is green |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
hmm, would it be possible to instead filter the alternatively, accept all |
according to the rfc it seems (at least for me) that this is only for structs https://github.com/rust-lang/rfcs/blob/master/text/1199-simd-infrastructure.md#types |
|
Yes, but is this a guarantee that we'll never extend it to unions? My point is not that the code is wrong, it's that this code adds an implicit dependency which may result in bugs in the future. Most bugs in large projects happen by:
This implies that a good way to avoid bugs in large projects it to avoid unchecked assumptions. It's why exhaustive matches are so powerful. It's also why we do stuff like rust/compiler/rustc_middle/src/ty/context.rs Lines 628 to 635 in 0bbef55
|
Fixes #148634
The ICE happened because
rust/compiler/rustc_middle/src/ty/mod.rs
Line 1531 in 995c118
will always set
IS_SIMDaccording toget_all_attrs, and since we already report errorattribute should be applied to a struct, it's OK to bypass here.