@@ -65,25 +65,22 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
65
65
let func_ty = self . operand_ty ( func) ;
66
66
let fn_def = match func_ty. sty {
67
67
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) ;
70
69
let fn_ptr = self . eval_operand_to_primval ( func) ?. to_ptr ( ) ?;
71
70
let fn_def = self . memory . get_fn ( fn_ptr. alloc_id ) ?;
72
71
match fn_def {
73
72
Function :: Concrete ( fn_def) => {
74
73
// transmuting function pointers in miri is fine as long as the number of
75
74
// 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 ) ;
78
76
if sig. abi != bare_sig. abi ||
79
77
sig. variadic != bare_sig. variadic ||
80
78
sig. inputs_and_output != bare_sig. inputs_and_output {
81
79
return Err ( EvalError :: FunctionPointerTyMismatch ( sig, bare_sig) ) ;
82
80
}
83
81
} ,
84
82
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 ) ;
87
84
assert_eq ! ( sig. abi, Abi :: RustCall ) ;
88
85
if sig. variadic != bare_sig. variadic ||
89
86
sig. inputs ( ) . len ( ) != 1 {
@@ -170,8 +167,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
170
167
match fn_def {
171
168
// Intrinsics can only be addressed directly
172
169
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) ;
175
171
let ty = sig. output ( ) ;
176
172
let layout = self . type_layout ( ty) ?;
177
173
let ( ret, target) = match destination {
@@ -184,8 +180,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
184
180
} ,
185
181
// C functions can only be addressed directly
186
182
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) ;
189
184
let ty = sig. output ( ) ;
190
185
let ( ret, target) = destination. unwrap ( ) ;
191
186
self . call_c_abi ( def_id, arg_operands, ret, ty) ?;
@@ -275,8 +270,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
275
270
)
276
271
} ,
277
272
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) ;
280
274
let mut args = Vec :: new ( ) ;
281
275
for arg in arg_operands {
282
276
let arg_val = self . eval_operand ( arg) ?;
0 commit comments