@@ -27,7 +27,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
27
27
// discriminant, so we cannot do anything here.
28
28
// When evaluating we will always error before even getting here, but ConstProp 'executes'
29
29
// dead code, so we cannot ICE here.
30
- if dest. layout ( ) . for_variant ( self , variant_index) . abi . is_uninhabited ( ) {
30
+ if dest. layout ( ) . for_variant ( self , variant_index) . is_uninhabited ( ) {
31
31
throw_ub ! ( UninhabitedEnumVariantWritten ( variant_index) )
32
32
}
33
33
@@ -86,7 +86,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
86
86
// For consistency with `write_discriminant`, and to make sure that
87
87
// `project_downcast` cannot fail due to strange layouts, we declare immediate UB
88
88
// for uninhabited variants.
89
- if op. layout ( ) . for_variant ( self , index) . abi . is_uninhabited ( ) {
89
+ if op. layout ( ) . for_variant ( self , index) . is_uninhabited ( ) {
90
90
throw_ub ! ( UninhabitedEnumVariantRead ( index) )
91
91
}
92
92
}
@@ -203,7 +203,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
203
203
// Reading the discriminant of an uninhabited variant is UB. This is the basis for the
204
204
// `uninhabited_enum_branching` MIR pass. It also ensures consistency with
205
205
// `write_discriminant`.
206
- if op. layout ( ) . for_variant ( self , index) . abi . is_uninhabited ( ) {
206
+ if op. layout ( ) . for_variant ( self , index) . is_uninhabited ( ) {
207
207
throw_ub ! ( UninhabitedEnumVariantRead ( index) )
208
208
}
209
209
interp_ok ( index)
0 commit comments