about summary refs log tree commit diff
path: root/library/core/src/array/equality.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-26 12:50:02 +0000
committerbors <bors@rust-lang.org>2024-01-26 12:50:02 +0000
commitcdd4ff8d8179197ba25708e0d85a4fc30f0a4971 (patch)
tree8b922cc56de9caa15fe0d9d3988f3e46cbf986ef /library/core/src/array/equality.rs
parent1fc46f3a8f12622c077f533da9e6dc3c227bbbb2 (diff)
parent64cd13ff3b9b5ca0ed88cd1cfd0d15aca846da7e (diff)
downloadrust-cdd4ff8d8179197ba25708e0d85a4fc30f0a4971.tar.gz
rust-cdd4ff8d8179197ba25708e0d85a4fc30f0a4971.zip
Auto merge of #120367 - RalfJung:project_downcast_uninhabited, r=oli-obk
interpret: project_downcast: do not ICE for uninhabited variants

Fixes https://github.com/rust-lang/rust/issues/120337

This assertion was already under discussion for a bit; I think the [example](https://github.com/rust-lang/rust/issues/120337#issuecomment-1911076292) `@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`
Diffstat (limited to 'library/core/src/array/equality.rs')
0 files changed, 0 insertions, 0 deletions