Skip to content

Commit b4e7064

Browse files
authored
Rollup merge of #133702 - RalfJung:single-variant, r=oli-obk
Variants::Single: do not use invalid VariantIdx for uninhabited enums ~~Stacked on top of rust-lang/rust#133681, only the last commit is new.~~ Currently, `Variants::Single` for an empty enum contains a `VariantIdx` of 0; looking that up in the enum variant list will ICE. That's quite confusing. So let's fix that by adding a new `Variants::Empty` case for types that have 0 variants. try-job: i686-msvc
2 parents 52d7e45 + 35395af commit b4e7064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
605605
// `UnsafeCell` action.
606606
(self.unsafe_cell_action)(v)
607607
}
608-
Variants::Single { .. } => {
608+
Variants::Single { .. } | Variants::Empty => {
609609
// Proceed further, try to find where exactly that `UnsafeCell`
610610
// is hiding.
611611
self.walk_value(v)

0 commit comments

Comments
 (0)