@@ -12,7 +12,8 @@ use rustc_data_structures::small_c_str::SmallCStr;
12
12
use rustc_hir:: def_id:: DefId ;
13
13
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrs ;
14
14
use rustc_middle:: ty:: layout:: {
15
- FnAbiError , FnAbiOfHelpers , FnAbiRequest , LayoutError , LayoutOfHelpers , TyAndLayout ,
15
+ FnAbiError , FnAbiOfHelpers , FnAbiRequest , HasParamEnv , LayoutError , LayoutOfHelpers ,
16
+ TyAndLayout ,
16
17
} ;
17
18
use rustc_middle:: ty:: { self , Instance , Ty , TyCtxt } ;
18
19
use rustc_sanitizers:: { cfi, kcfi} ;
@@ -531,7 +532,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
531
532
#[ instrument( level = "trace" , skip( self ) ) ]
532
533
fn load_operand ( & mut self , place : PlaceRef < ' tcx , & ' ll Value > ) -> OperandRef < ' tcx , & ' ll Value > {
533
534
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 ( ) ) ;
535
536
if matches ! ( tail. kind( ) , ty:: Foreign ( ..) ) {
536
537
// Unsized locals and, at least conceptually, even unsized arguments must be copied
537
538
// around, which requires dynamically determining their size. Therefore, we cannot
0 commit comments