@@ -212,7 +212,7 @@ pub(crate) mod rustc {
212
212
return Err ( Err :: TypeError ( e) ) ;
213
213
}
214
214
215
- let target = cx. tcx . data_layout ( ) ;
215
+ let target = cx. data_layout ( ) ;
216
216
let pointer_size = target. pointer_size ;
217
217
218
218
match ty. kind ( ) {
@@ -320,7 +320,7 @@ pub(crate) mod rustc {
320
320
321
321
// Computes the variant of a given index.
322
322
let layout_of_variant = |index, encoding : Option < TagEncoding < VariantIdx > > | {
323
- let tag = cx. tcx . tag_for_variant ( ( cx. tcx . erase_regions ( ty) , index) ) ;
323
+ let tag = cx. tcx ( ) . tag_for_variant ( ( cx. tcx ( ) . erase_regions ( ty) , index) ) ;
324
324
let variant_def = Def :: Variant ( def. variant ( index) ) ;
325
325
let variant_layout = ty_variant ( cx, ( ty, layout) , index) ;
326
326
Self :: from_variant (
@@ -417,7 +417,7 @@ pub(crate) mod rustc {
417
417
}
418
418
}
419
419
}
420
- struct_tree = struct_tree. then ( Self :: from_tag ( * tag, cx. tcx ) ) ;
420
+ struct_tree = struct_tree. then ( Self :: from_tag ( * tag, cx. tcx ( ) ) ) ;
421
421
}
422
422
423
423
// Append the fields, in memory order, to the layout.
@@ -509,12 +509,12 @@ pub(crate) mod rustc {
509
509
match layout. variants {
510
510
Variants :: Single { index } => {
511
511
let field = & def. variant ( index) . fields [ i] ;
512
- field. ty ( cx. tcx , args)
512
+ field. ty ( cx. tcx ( ) , args)
513
513
}
514
514
// Discriminant field for enums (where applicable).
515
515
Variants :: Multiple { tag, .. } => {
516
516
assert_eq ! ( i. as_usize( ) , 0 ) ;
517
- ty:: layout:: PrimitiveExt :: to_ty ( & tag. primitive ( ) , cx. tcx )
517
+ ty:: layout:: PrimitiveExt :: to_ty ( & tag. primitive ( ) , cx. tcx ( ) )
518
518
}
519
519
}
520
520
}
@@ -531,7 +531,7 @@ pub(crate) mod rustc {
531
531
( ty, layout) : ( Ty < ' tcx > , Layout < ' tcx > ) ,
532
532
i : VariantIdx ,
533
533
) -> Layout < ' tcx > {
534
- let ty = cx. tcx . erase_regions ( ty) ;
534
+ let ty = cx. tcx ( ) . erase_regions ( ty) ;
535
535
TyAndLayout { ty, layout } . for_variant ( & cx, i) . layout
536
536
}
537
537
}
0 commit comments