@@ -42,10 +42,10 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
42
42
Variants :: Multiple {
43
43
tag : _,
44
44
tag_field,
45
- tag_encoding : TagEncoding :: Niche { dataful_variant , ref niche_variants, niche_start } ,
45
+ tag_encoding : TagEncoding :: Niche { untagged_variant , ref niche_variants, niche_start } ,
46
46
variants : _,
47
47
} => {
48
- if variant_index != dataful_variant {
48
+ if variant_index != untagged_variant {
49
49
let niche = place. place_field ( fx, mir:: Field :: new ( tag_field) ) ;
50
50
let niche_value = variant_index. as_u32 ( ) - niche_variants. start ( ) . as_u32 ( ) ;
51
51
let niche_value = ty:: ScalarInt :: try_from_uint (
@@ -113,7 +113,7 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
113
113
let res = CValue :: by_val ( val, dest_layout) ;
114
114
dest. write_cvalue ( fx, res) ;
115
115
}
116
- TagEncoding :: Niche { dataful_variant , ref niche_variants, niche_start } => {
116
+ TagEncoding :: Niche { untagged_variant , ref niche_variants, niche_start } => {
117
117
// Rebase from niche values to discriminants, and check
118
118
// whether the result is in range for the niche variants.
119
119
@@ -169,8 +169,9 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
169
169
fx. bcx . ins ( ) . iadd_imm ( relative_discr, i64:: from ( niche_variants. start ( ) . as_u32 ( ) ) )
170
170
} ;
171
171
172
- let dataful_variant = fx. bcx . ins ( ) . iconst ( cast_to, i64:: from ( dataful_variant. as_u32 ( ) ) ) ;
173
- let discr = fx. bcx . ins ( ) . select ( is_niche, niche_discr, dataful_variant) ;
172
+ let untagged_variant =
173
+ fx. bcx . ins ( ) . iconst ( cast_to, i64:: from ( untagged_variant. as_u32 ( ) ) ) ;
174
+ let discr = fx. bcx . ins ( ) . select ( is_niche, niche_discr, untagged_variant) ;
174
175
let res = CValue :: by_val ( discr, dest_layout) ;
175
176
dest. write_cvalue ( fx, res) ;
176
177
}
0 commit comments