-
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
Fix ICE for repr simd on non struct #148638
Conversation
|
r=me when ci is green |
This comment has been minimized.
This comment has been minimized.
|
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
|
995c118 to
112d833
Compare
|
@lcnr I'm thinking do we need to delay_as_bug, since if we already returned |
|
Ok, |
|
@rustbot ready |
|
@bors delegate+ |
|
✌️ @chenyukang, you can now approve this pull request! If @lcnr told you to " |
a21210d to
df57c32
Compare
|
@bors r=Kivooeo,lcnr |
…simd-enum-ice, r=Kivooeo,lcnr Fix ICE for repr simd on non struct Fixes rust-lang#148634 The ICE happened because https://github.com/rust-lang/rust/blob/995c11894fdabe1c630694254de756f82389c6cf/compiler/rustc_middle/src/ty/mod.rs#L1531 will always set `IS_SIMD` according to `get_all_attrs`, and since we already report error `attribute should be applied to a struct`, it's OK to bypass here.
|
@bors try jobs=test-various |
This comment has been minimized.
This comment has been minimized.
…ce, r=<try> Fix ICE for repr simd on non struct try-job: test-various
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 2c4f26b failed: CI. Failed jobs:
|
53cfe97 to
f9cf0c4
Compare
|
@bors try jobs=test-various |
This comment has been minimized.
This comment has been minimized.
…ce, r=<try> Fix ICE for repr simd on non struct try-job: test-various
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 5ec32cc failed: CI. Failed jobs:
|
f9cf0c4 to
1610851
Compare
|
@bors try jobs=test-various |
…ce, r=<try> Fix ICE for repr simd on non struct try-job: test-various
This comment has been minimized.
This comment has been minimized.
|
finally it's passed, I added |
…ce, r=Kivooeo,lcnr Fix ICE for repr simd on non struct Fixes #148634 The ICE happened because https://github.com/rust-lang/rust/blob/995c11894fdabe1c630694254de756f82389c6cf/compiler/rustc_middle/src/ty/mod.rs#L1531 will always set `IS_SIMD` according to `get_all_attrs`, and since we already report error `attribute should be applied to a struct`, it's OK to bypass here.
|
Yielding to enclosing rollup. @bors retry |
Rollup of 4 pull requests Successful merges: - #148638 (Fix ICE for repr simd on non struct) - #148725 (Implement the alternative `try` block desugaring) - #148777 (Lock shards while emitting depth limit error.) - #148933 (Add note for option llvm.download-ci-llvm) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #148638 - chenyukang:yukang-fix-148634-repr-simd-enum-ice, r=Kivooeo,lcnr Fix ICE for repr simd on non struct Fixes #148634 The ICE happened because https://github.com/rust-lang/rust/blob/995c11894fdabe1c630694254de756f82389c6cf/compiler/rustc_middle/src/ty/mod.rs#L1531 will always set `IS_SIMD` according to `get_all_attrs`, and since we already report error `attribute should be applied to a struct`, it's OK to bypass here.
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.