@@ -28,7 +28,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
28
28
tag_encoding : TagEncoding :: Direct ,
29
29
variants : _,
30
30
} => {
31
- let ptr = place. place_field ( fx, FieldIdx :: new ( tag_field) ) ;
31
+ let ptr = place. place_field ( fx, tag_field) ;
32
32
let to = layout. ty . discriminant_for_variant ( fx. tcx , variant_index) . unwrap ( ) . val ;
33
33
let to = match ptr. layout ( ) . ty . kind ( ) {
34
34
ty:: Uint ( UintTy :: U128 ) | ty:: Int ( IntTy :: I128 ) => {
@@ -53,7 +53,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
53
53
variants : _,
54
54
} => {
55
55
if variant_index != untagged_variant {
56
- let niche = place. place_field ( fx, FieldIdx :: new ( tag_field) ) ;
56
+ let niche = place. place_field ( fx, tag_field) ;
57
57
let niche_type = fx. clif_type ( niche. layout ( ) . ty ) . unwrap ( ) ;
58
58
let niche_value = variant_index. as_u32 ( ) - niche_variants. start ( ) . as_u32 ( ) ;
59
59
let niche_value = ( niche_value as u128 ) . wrapping_add ( niche_start) ;
@@ -118,7 +118,7 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
118
118
let cast_to = fx. clif_type ( dest_layout. ty ) . unwrap ( ) ;
119
119
120
120
// Read the tag/niche-encoded discriminant from memory.
121
- let tag = value. value_field ( fx, FieldIdx :: new ( tag_field) ) ;
121
+ let tag = value. value_field ( fx, tag_field) ;
122
122
let tag = tag. load_scalar ( fx) ;
123
123
124
124
// Decode the discriminant (specifically if it's niche-encoded).
0 commit comments