@@ -229,7 +229,7 @@ impl<'tcx> GotocCtx<'tcx> {
229229 if let Some ( current_fn) = & self . current_fn {
230230 current_fn. instance ( ) . instantiate_mir_and_normalize_erasing_regions (
231231 self . tcx ,
232- ty:: ParamEnv :: reveal_all ( ) ,
232+ ty:: TypingEnv :: fully_monomorphized ( ) ,
233233 ty:: EarlyBinder :: bind ( value) ,
234234 )
235235 } else {
@@ -251,7 +251,7 @@ impl<'tcx> GotocCtx<'tcx> {
251251 pub fn is_unsized ( & self , t : Ty < ' tcx > ) -> bool {
252252 !self
253253 . monomorphize ( t)
254- . is_sized ( * self . tcx . at ( rustc_span:: DUMMY_SP ) , ty:: ParamEnv :: reveal_all ( ) )
254+ . is_sized ( * self . tcx . at ( rustc_span:: DUMMY_SP ) , ty:: TypingEnv :: fully_monomorphized ( ) )
255255 }
256256
257257 /// Generates the type for a single field for a dynamic vtable.
@@ -523,7 +523,8 @@ impl<'tcx> GotocCtx<'tcx> {
523523 /// c.f. <https://rust-lang.github.io/unsafe-code-guidelines/introduction.html>
524524 pub fn codegen_ty ( & mut self , ty : Ty < ' tcx > ) -> Type {
525525 // TODO: Remove all monomorphize calls
526- let normalized = self . tcx . normalize_erasing_regions ( ty:: ParamEnv :: reveal_all ( ) , ty) ;
526+ let normalized =
527+ self . tcx . normalize_erasing_regions ( ty:: TypingEnv :: fully_monomorphized ( ) , ty) ;
527528 let goto_typ = self . codegen_ty_inner ( normalized) ;
528529 if let Some ( tag) = goto_typ. tag ( ) {
529530 self . type_map . entry ( tag) . or_insert_with ( || {
@@ -573,10 +574,14 @@ impl<'tcx> GotocCtx<'tcx> {
573574 ty:: Str => Type :: unsigned_int ( 8 ) . flexible_array_of ( ) ,
574575 ty:: Ref ( _, t, _) | ty:: RawPtr ( t, _) => self . codegen_ty_ref ( * t) ,
575576 ty:: FnDef ( def_id, args) => {
576- let instance =
577- Instance :: try_resolve ( self . tcx , ty:: ParamEnv :: reveal_all ( ) , * def_id, args)
578- . unwrap ( )
579- . unwrap ( ) ;
577+ let instance = Instance :: try_resolve (
578+ self . tcx ,
579+ ty:: TypingEnv :: fully_monomorphized ( ) ,
580+ * def_id,
581+ args,
582+ )
583+ . unwrap ( )
584+ . unwrap ( ) ;
580585 self . codegen_fndef_type ( instance)
581586 }
582587 ty:: FnPtr ( sig_tys, hdr) => {
@@ -980,7 +985,7 @@ impl<'tcx> GotocCtx<'tcx> {
980985 // Normalize pointee_type to remove projection and opaque types
981986 trace ! ( ?pointee_type, "codegen_ty_ref" ) ;
982987 let pointee_type =
983- self . tcx . normalize_erasing_regions ( ty:: ParamEnv :: reveal_all ( ) , pointee_type) ;
988+ self . tcx . normalize_erasing_regions ( ty:: TypingEnv :: fully_monomorphized ( ) , pointee_type) ;
984989
985990 if !self . use_thin_pointer ( pointee_type) {
986991 return self . codegen_fat_ptr ( pointee_type) ;
@@ -1076,7 +1081,9 @@ impl<'tcx> GotocCtx<'tcx> {
10761081 /// one can only apply this function to a monomorphized signature
10771082 pub fn codegen_function_sig ( & mut self , sig : PolyFnSig < ' tcx > ) -> Type {
10781083 let sig = self . monomorphize ( sig) ;
1079- let sig = self . tcx . normalize_erasing_late_bound_regions ( ty:: ParamEnv :: reveal_all ( ) , sig) ;
1084+ let sig = self
1085+ . tcx
1086+ . normalize_erasing_late_bound_regions ( ty:: TypingEnv :: fully_monomorphized ( ) , sig) ;
10801087 self . codegen_function_sig_stable ( rustc_internal:: stable ( sig) )
10811088 }
10821089
0 commit comments