@@ -21,7 +21,7 @@ use rustc_middle::{
21
21
query:: TyCtxtAt ,
22
22
ty:: {
23
23
self ,
24
- layout:: { LayoutCx , LayoutError , LayoutOf , TyAndLayout } ,
24
+ layout:: { HasTyCtxt , LayoutCx , LayoutError , LayoutOf , TyAndLayout } ,
25
25
Instance , Ty , TyCtxt ,
26
26
} ,
27
27
} ;
@@ -381,8 +381,8 @@ pub struct PrimitiveLayouts<'tcx> {
381
381
}
382
382
383
383
impl < ' tcx > PrimitiveLayouts < ' tcx > {
384
- fn new ( layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ) -> Result < Self , & ' tcx LayoutError < ' tcx > > {
385
- let tcx = layout_cx. tcx ;
384
+ fn new ( layout_cx : LayoutCx < ' tcx > ) -> Result < Self , & ' tcx LayoutError < ' tcx > > {
385
+ let tcx = layout_cx. tcx ( ) ;
386
386
let mut_raw_ptr = Ty :: new_mut_ptr ( tcx, tcx. types . unit ) ;
387
387
let const_raw_ptr = Ty :: new_imm_ptr ( tcx, tcx. types . unit ) ;
388
388
Ok ( Self {
@@ -596,14 +596,13 @@ pub struct MiriMachine<'tcx> {
596
596
}
597
597
598
598
impl < ' tcx > MiriMachine < ' tcx > {
599
- pub ( crate ) fn new ( config : & MiriConfig , layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ) -> Self {
600
- let tcx = layout_cx. tcx ;
599
+ pub ( crate ) fn new ( config : & MiriConfig , layout_cx : LayoutCx < ' tcx > ) -> Self {
600
+ let tcx = layout_cx. tcx ( ) ;
601
601
let local_crates = helpers:: get_local_crates ( tcx) ;
602
602
let layouts =
603
603
PrimitiveLayouts :: new ( layout_cx) . expect ( "Couldn't get layouts of primitive types" ) ;
604
604
let profiler = config. measureme_out . as_ref ( ) . map ( |out| {
605
- let crate_name = layout_cx
606
- . tcx
605
+ let crate_name = tcx
607
606
. sess
608
607
. opts
609
608
. crate_name
@@ -701,7 +700,7 @@ impl<'tcx> MiriMachine<'tcx> {
701
700
clock : Clock :: new ( config. isolated_op == IsolatedOp :: Allow ) ,
702
701
#[ cfg( unix) ]
703
702
native_lib : config. native_lib . as_ref ( ) . map ( |lib_file_path| {
704
- let target_triple = layout_cx . tcx . sess . opts . target_triple . triple ( ) ;
703
+ let target_triple = tcx. sess . opts . target_triple . triple ( ) ;
705
704
// Check if host target == the session target.
706
705
if env ! ( "TARGET" ) != target_triple {
707
706
panic ! (
0 commit comments