-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Correctly account for niche-optimized tags in rustc_transmute #130371
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -359,7 +365,7 @@ pub(crate) mod rustc { | |||
let variants = def.discriminants(cx.tcx()).try_fold( | |||
Self::uninhabited(), | |||
|variants, (idx, ref discriminant)| { | |||
let variant = layout_of_variant(idx)?; | |||
let variant = layout_of_variant(idx, Some(tag_encoding.clone()))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fact that RangeInclusive
is not Copy
is criminal tbh
r=me when green |
@bors r=compiler-errors |
Tremendous thanks for this @saethlin!!! |
Please keep me posted about this experiment! It sounds like a great way to burn down ICEs in |
… r=compiler-errors Correctly account for niche-optimized tags in rustc_transmute This is a bit hacky, but it fixes the ICE and makes it possible to run the safe transmute check on every `mem::transmute` check we instantiate. I want to write a lint that needs to do that, but this stands well on its own. cc `@jswrenn` here's the fix I alluded to yesterday :) Fixes rust-lang#123693
… r=compiler-errors Correctly account for niche-optimized tags in rustc_transmute This is a bit hacky, but it fixes the ICE and makes it possible to run the safe transmute check on every `mem::transmute` check we instantiate. I want to write a lint that needs to do that, but this stands well on its own. cc `@jswrenn` here's the fix I alluded to yesterday :) Fixes rust-lang#123693
… r=compiler-errors Correctly account for niche-optimized tags in rustc_transmute This is a bit hacky, but it fixes the ICE and makes it possible to run the safe transmute check on every `mem::transmute` check we instantiate. I want to write a lint that needs to do that, but this stands well on its own. cc ``@jswrenn`` here's the fix I alluded to yesterday :) Fixes rust-lang#123693
…kingjubilee Rollup of 3 pull requests Successful merges: - rust-lang#130295 (Fix target-cpu fpu features on Armv8-R.) - rust-lang#130325 (Use -0.0 in `intrinsics::simd::reduce_add_unordered`) - rust-lang#130371 (Correctly account for niche-optimized tags in rustc_transmute) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#129195 (Stabilize `&mut` (and `*mut`) as well as `&Cell` (and `*const Cell`) in const) - rust-lang#130118 (move Option::unwrap_unchecked into const_option feature gate) - rust-lang#130295 (Fix target-cpu fpu features on Armv8-R.) - rust-lang#130371 (Correctly account for niche-optimized tags in rustc_transmute) - rust-lang#130381 (library: Compute Rust exception class from its string repr) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130371 - saethlin:transmutability-enum-ice, r=compiler-errors Correctly account for niche-optimized tags in rustc_transmute This is a bit hacky, but it fixes the ICE and makes it possible to run the safe transmute check on every `mem::transmute` check we instantiate. I want to write a lint that needs to do that, but this stands well on its own. cc `@jswrenn` here's the fix I alluded to yesterday :) Fixes rust-lang#123693
This is a bit hacky, but it fixes the ICE and makes it possible to run the safe transmute check on every
mem::transmute
check we instantiate. I want to write a lint that needs to do that, but this stands well on its own.cc @jswrenn here's the fix I alluded to yesterday :)
Fixes #123693