@@ -2581,9 +2581,12 @@ impl<'tcx> ty::Instance<'tcx> {
2581
2581
// for `Instance` (e.g. typeck would use `Ty::fn_sig` instead),
2582
2582
// or should go through `FnAbi` instead, to avoid losing any
2583
2583
// adjustments `fn_abi_of_instance` might be performing.
2584
- fn fn_sig_for_fn_abi ( & self , tcx : TyCtxt < ' tcx > ) -> ty:: PolyFnSig < ' tcx > {
2585
- // FIXME(davidtwco,eddyb): A `ParamEnv` should be passed through to this function.
2586
- let ty = self . ty ( tcx, ty:: ParamEnv :: reveal_all ( ) ) ;
2584
+ fn fn_sig_for_fn_abi (
2585
+ & self ,
2586
+ tcx : TyCtxt < ' tcx > ,
2587
+ param_env : ty:: ParamEnv < ' tcx > ,
2588
+ ) -> ty:: PolyFnSig < ' tcx > {
2589
+ let ty = self . ty ( tcx, param_env) ;
2587
2590
match * ty. kind ( ) {
2588
2591
ty:: FnDef ( ..) => {
2589
2592
// HACK(davidtwco,eddyb): This is a workaround for polymorphization considering
@@ -2965,7 +2968,7 @@ fn fn_abi_of_instance<'tcx>(
2965
2968
) -> Result < & ' tcx FnAbi < ' tcx , Ty < ' tcx > > , FnAbiError < ' tcx > > {
2966
2969
let ( param_env, ( instance, extra_args) ) = query. into_parts ( ) ;
2967
2970
2968
- let sig = instance. fn_sig_for_fn_abi ( tcx) ;
2971
+ let sig = instance. fn_sig_for_fn_abi ( tcx, param_env ) ;
2969
2972
2970
2973
let caller_location = if instance. def . requires_caller_location ( tcx) {
2971
2974
Some ( tcx. caller_location_ty ( ) )
0 commit comments