Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #120367 - RalfJung:project_downcast_uninhabited, r=oli-obk
interpret: project_downcast: do not ICE for uninhabited variants Fixes rust-lang/rust#120337 This assertion was already under discussion for a bit; I think the [example](rust-lang/rust#120337 (comment)) `@tmiasko` found is the final nail in the coffin. One could argue maybe MIR building should read the discriminant before projecting, but even then MIR optimizations should be allowed to remove that read, so the downcast should still not ICE. Maybe the downcast should be UB, but in this example UB already arises earlier when a value of type `E` is constructed. r? `@oli-obk`
- Loading branch information