@@ -115,7 +115,7 @@ use rustc_target::abi::Endian;
115115use crate :: mir;
116116use crate :: ty:: codec:: { TyDecoder , TyEncoder } ;
117117use crate :: ty:: subst:: GenericArgKind ;
118- use crate :: ty:: { self , Instance , Ty , TyCtxt , TyInterner } ;
118+ use crate :: ty:: { self , Instance , Ty , TyCtxt } ;
119119
120120pub use self :: error:: {
121121 struct_error, CheckInAllocMsg , ErrorHandled , EvalToAllocationRawResult , EvalToConstValueResult ,
@@ -203,7 +203,7 @@ enum AllocDiscriminant {
203203 Static ,
204204}
205205
206- pub fn specialized_encode_alloc_id < ' tcx , E : TyEncoder < I = TyInterner < ' tcx > > > (
206+ pub fn specialized_encode_alloc_id < ' tcx , E : TyEncoder < I = TyCtxt < ' tcx > > > (
207207 encoder : & mut E ,
208208 tcx : TyCtxt < ' tcx > ,
209209 alloc_id : AllocId ,
@@ -277,7 +277,7 @@ impl<'s> AllocDecodingSession<'s> {
277277 /// Decodes an `AllocId` in a thread-safe way.
278278 pub fn decode_alloc_id < ' tcx , D > ( & self , decoder : & mut D ) -> AllocId
279279 where
280- D : TyDecoder < I = TyInterner < ' tcx > > ,
280+ D : TyDecoder < I = TyCtxt < ' tcx > > ,
281281 {
282282 // Read the index of the allocation.
283283 let idx = usize:: try_from ( decoder. read_u32 ( ) ) . unwrap ( ) ;
@@ -305,7 +305,7 @@ impl<'s> AllocDecodingSession<'s> {
305305 AllocDiscriminant :: Alloc => {
306306 // If this is an allocation, we need to reserve an
307307 // `AllocId` so we can decode cyclic graphs.
308- let alloc_id = decoder. interner ( ) . tcx . reserve_alloc_id ( ) ;
308+ let alloc_id = decoder. interner ( ) . reserve_alloc_id ( ) ;
309309 * entry =
310310 State :: InProgress ( TinyList :: new_single ( self . session_id ) , alloc_id) ;
311311 Some ( alloc_id)
@@ -349,23 +349,23 @@ impl<'s> AllocDecodingSession<'s> {
349349 // We already have a reserved `AllocId`.
350350 let alloc_id = alloc_id. unwrap ( ) ;
351351 trace ! ( "decoded alloc {:?}: {:#?}" , alloc_id, alloc) ;
352- decoder. interner ( ) . tcx . set_alloc_id_same_memory ( alloc_id, alloc) ;
352+ decoder. interner ( ) . set_alloc_id_same_memory ( alloc_id, alloc) ;
353353 alloc_id
354354 }
355355 AllocDiscriminant :: Fn => {
356356 assert ! ( alloc_id. is_none( ) ) ;
357357 trace ! ( "creating fn alloc ID" ) ;
358358 let instance = ty:: Instance :: decode ( decoder) ;
359359 trace ! ( "decoded fn alloc instance: {:?}" , instance) ;
360- let alloc_id = decoder. interner ( ) . tcx . create_fn_alloc ( instance) ;
360+ let alloc_id = decoder. interner ( ) . create_fn_alloc ( instance) ;
361361 alloc_id
362362 }
363363 AllocDiscriminant :: Static => {
364364 assert ! ( alloc_id. is_none( ) ) ;
365365 trace ! ( "creating extern static alloc ID" ) ;
366366 let did = <DefId as Decodable < D > >:: decode ( decoder) ;
367367 trace ! ( "decoded static def-ID: {:?}" , did) ;
368- let alloc_id = decoder. interner ( ) . tcx . create_static_alloc ( did) ;
368+ let alloc_id = decoder. interner ( ) . create_static_alloc ( did) ;
369369 alloc_id
370370 }
371371 }
0 commit comments