@@ -65,25 +65,22 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
6565 let func_ty = self . operand_ty ( func) ;
6666 let fn_def = match func_ty. sty {
6767 ty:: TyFnPtr ( bare_sig) => {
68- let bare_sig = self . tcx . erase_late_bound_regions ( & bare_sig) ;
69- let bare_sig = self . tcx . erase_regions ( & bare_sig) ;
68+ let bare_sig = self . erase_lifetimes ( & bare_sig) ;
7069 let fn_ptr = self . eval_operand_to_primval ( func) ?. to_ptr ( ) ?;
7170 let fn_def = self . memory . get_fn ( fn_ptr. alloc_id ) ?;
7271 match fn_def {
7372 Function :: Concrete ( fn_def) => {
7473 // transmuting function pointers in miri is fine as long as the number of
7574 // arguments and the abi don't change.
76- let sig = self . tcx . erase_late_bound_regions ( & fn_def. sig ) ;
77- let sig = self . tcx . erase_regions ( & sig) ;
75+ let sig = self . erase_lifetimes ( & fn_def. sig ) ;
7876 if sig. abi != bare_sig. abi ||
7977 sig. variadic != bare_sig. variadic ||
8078 sig. inputs_and_output != bare_sig. inputs_and_output {
8179 return Err ( EvalError :: FunctionPointerTyMismatch ( sig, bare_sig) ) ;
8280 }
8381 } ,
8482 Function :: NonCaptureClosureAsFnPtr ( fn_def) => {
85- let sig = self . tcx . erase_late_bound_regions ( & fn_def. sig ) ;
86- let sig = self . tcx . erase_regions ( & sig) ;
83+ let sig = self . erase_lifetimes ( & fn_def. sig ) ;
8784 assert_eq ! ( sig. abi, Abi :: RustCall ) ;
8885 if sig. variadic != bare_sig. variadic ||
8986 sig. inputs ( ) . len ( ) != 1 {
@@ -170,8 +167,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
170167 match fn_def {
171168 // Intrinsics can only be addressed directly
172169 Function :: Concrete ( FunctionDefinition { def_id, substs, sig } ) if sig. abi ( ) == Abi :: RustIntrinsic => {
173- let sig = self . tcx . erase_late_bound_regions ( & sig) ;
174- let sig = self . tcx . erase_regions ( & sig) ;
170+ let sig = self . erase_lifetimes ( & sig) ;
175171 let ty = sig. output ( ) ;
176172 let layout = self . type_layout ( ty) ?;
177173 let ( ret, target) = match destination {
@@ -184,8 +180,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
184180 } ,
185181 // C functions can only be addressed directly
186182 Function :: Concrete ( FunctionDefinition { def_id, sig, ..} ) if sig. abi ( ) == Abi :: C => {
187- let sig = self . tcx . erase_late_bound_regions ( & sig) ;
188- let sig = self . tcx . erase_regions ( & sig) ;
183+ let sig = self . erase_lifetimes ( & sig) ;
189184 let ty = sig. output ( ) ;
190185 let ( ret, target) = destination. unwrap ( ) ;
191186 self . call_c_abi ( def_id, arg_operands, ret, ty) ?;
@@ -275,8 +270,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
275270 )
276271 } ,
277272 Function :: NonCaptureClosureAsFnPtr ( FunctionDefinition { def_id, substs, sig } ) if sig. abi ( ) == Abi :: RustCall => {
278- let sig = self . tcx . erase_late_bound_regions ( & sig) ;
279- let sig = self . tcx . erase_regions ( & sig) ;
273+ let sig = self . erase_lifetimes ( & sig) ;
280274 let mut args = Vec :: new ( ) ;
281275 for arg in arg_operands {
282276 let arg_val = self . eval_operand ( arg) ?;
0 commit comments