Add bug! for unused OpaqueCast post borrowck#116140
Add bug! for unused OpaqueCast post borrowck#116140ouz-a wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
lcnr
left a comment
There was a problem hiding this comment.
can you add a comment to ProjectionElem::OpaqueCast that this projection should not exist in MirPase::Runtime, extend the changes mentioned in the MirPhase::Runtime(RuntimePhase::Initial) docs, and change the mir validator to fail if it encounters an OpaqueCast during MirPhase::Runtime
r=me afterwards
| Ok(match proj_elem { | ||
| OpaqueCast(ty) => base.transmute(self.layout_of(ty)?, self)?, | ||
| OpaqueCast(_) => { | ||
| bug!("OpaqueCast should be unreachable here!"); |
There was a problem hiding this comment.
Can you make this span_bug!(self.cur_span(), ...? That will make this much easier to debug, should that ever come up.
There was a problem hiding this comment.
this PR is sadly wrong given that OpaqueCast does exist after analysis, we just don't have a single test which actually encounters it 😅 @ouz-a will add such tests in a different PR 😁
|
As lcnr mentioned this pr is wrong, so closing it in favor of newer one. |
Monomorphize OpaqueCast In previous attempt, rust-lang#116140 we thought `OpaqueCast` was unused during few places, but we were wrong, in reality we didn't have any test that could test it, so in this pr attempt is to correct the behavior of few `OpaqueCast`s in rustc. r? `@lcnr`
Monomorphize OpaqueCast In previous attempt, rust-lang#116140 we thought `OpaqueCast` was unused during few places, but we were wrong, in reality we didn't have any test that could test it, so in this pr attempt is to correct the behavior of few `OpaqueCast`s in rustc. r? `@lcnr`
Monomorphize OpaqueCast In previous attempt, rust-lang#116140 we thought `OpaqueCast` was unused during few places, but we were wrong, in reality we didn't have any test that could test it, so in this pr attempt is to correct the behavior of few `OpaqueCast`s in rustc. r? `@lcnr`
While working on #115025 we discovered some of the
ProjectionElem::OpaqueCastwere unused, so this change reflects their current behavior more clearly.r? @lcnr