@@ -229,7 +229,7 @@ impl<'tcx> GotocCtx<'tcx> {
229
229
if let Some ( current_fn) = & self . current_fn {
230
230
current_fn. instance ( ) . instantiate_mir_and_normalize_erasing_regions (
231
231
self . tcx ,
232
- ty:: ParamEnv :: reveal_all ( ) ,
232
+ ty:: TypingEnv :: fully_monomorphized ( ) ,
233
233
ty:: EarlyBinder :: bind ( value) ,
234
234
)
235
235
} else {
@@ -251,7 +251,7 @@ impl<'tcx> GotocCtx<'tcx> {
251
251
pub fn is_unsized ( & self , t : Ty < ' tcx > ) -> bool {
252
252
!self
253
253
. 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 ( ) )
255
255
}
256
256
257
257
/// Generates the type for a single field for a dynamic vtable.
@@ -523,7 +523,8 @@ impl<'tcx> GotocCtx<'tcx> {
523
523
/// c.f. <https://rust-lang.github.io/unsafe-code-guidelines/introduction.html>
524
524
pub fn codegen_ty ( & mut self , ty : Ty < ' tcx > ) -> Type {
525
525
// 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) ;
527
528
let goto_typ = self . codegen_ty_inner ( normalized) ;
528
529
if let Some ( tag) = goto_typ. tag ( ) {
529
530
self . type_map . entry ( tag) . or_insert_with ( || {
@@ -573,10 +574,14 @@ impl<'tcx> GotocCtx<'tcx> {
573
574
ty:: Str => Type :: unsigned_int ( 8 ) . flexible_array_of ( ) ,
574
575
ty:: Ref ( _, t, _) | ty:: RawPtr ( t, _) => self . codegen_ty_ref ( * t) ,
575
576
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 ( ) ;
580
585
self . codegen_fndef_type ( instance)
581
586
}
582
587
ty:: FnPtr ( sig_tys, hdr) => {
@@ -980,7 +985,7 @@ impl<'tcx> GotocCtx<'tcx> {
980
985
// Normalize pointee_type to remove projection and opaque types
981
986
trace ! ( ?pointee_type, "codegen_ty_ref" ) ;
982
987
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) ;
984
989
985
990
if !self . use_thin_pointer ( pointee_type) {
986
991
return self . codegen_fat_ptr ( pointee_type) ;
@@ -1076,7 +1081,9 @@ impl<'tcx> GotocCtx<'tcx> {
1076
1081
/// one can only apply this function to a monomorphized signature
1077
1082
pub fn codegen_function_sig ( & mut self , sig : PolyFnSig < ' tcx > ) -> Type {
1078
1083
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) ;
1080
1087
self . codegen_function_sig_stable ( rustc_internal:: stable ( sig) )
1081
1088
}
1082
1089
0 commit comments