@@ -12,7 +12,8 @@ use rustc_data_structures::small_c_str::SmallCStr;
1212use rustc_hir:: def_id:: DefId ;
1313use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
1414use rustc_middle:: ty:: layout:: {
15- FnAbiError , FnAbiOfHelpers , FnAbiRequest , LayoutError , LayoutOfHelpers , TyAndLayout ,
15+ FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , LayoutError , LayoutOfHelpers ,
16+ TyAndLayout ,
1617} ;
1718use rustc_middle:: ty:: { self , Instance , Ty , TyCtxt } ;
1819use rustc_sanitizers:: { cfi, kcfi} ;
@@ -531,7 +532,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
531532 #[ instrument( level = "trace" , skip( self ) ) ]
532533 fn load_operand ( & mut self , place : PlaceRef < ' tcx , & ' ll Value > ) -> OperandRef < ' tcx , & ' ll Value > {
533534 if place. layout . is_unsized ( ) {
534- let tail = self . tcx . struct_tail_with_normalize ( place. layout . ty , |ty| ty , || { } ) ;
535+ let tail = self . tcx . struct_tail_erasing_lifetimes ( place. layout . ty , self . param_env ( ) ) ;
535536 if matches ! ( tail. kind( ) , ty:: Foreign ( ..) ) {
536537 // Unsized locals and, at least conceptually, even unsized arguments must be copied
537538 // around, which requires dynamically determining their size. Therefore, we cannot
0 commit comments