14
14
use rustc:: mir;
15
15
use rustc:: ty:: { self , layout:: LayoutOf } ;
16
16
use rustc_target:: spec:: PanicStrategy ;
17
- use rustc_span:: source_map:: Span ;
18
17
19
18
use crate :: * ;
20
19
@@ -176,7 +175,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
176
175
177
176
fn assert_panic (
178
177
& mut self ,
179
- span : Span ,
180
178
msg : & mir:: AssertMessage < ' tcx > ,
181
179
unwind : Option < mir:: BasicBlock > ,
182
180
) -> InterpResult < ' tcx > {
@@ -187,19 +185,17 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
187
185
BoundsCheck { ref index, ref len } => {
188
186
// Forward to `panic_bounds_check` lang item.
189
187
190
- // First arg: Caller location.
191
- let location = this. alloc_caller_location_for_span ( span) ;
192
- // Second arg: index.
188
+ // First arg: index.
193
189
let index = this. read_scalar ( this. eval_operand ( index, None ) ?) ?;
194
- // Third arg: len.
190
+ // Second arg: len.
195
191
let len = this. read_scalar ( this. eval_operand ( len, None ) ?) ?;
196
192
197
193
// Call the lang item.
198
194
let panic_bounds_check = this. tcx . lang_items ( ) . panic_bounds_check_fn ( ) . unwrap ( ) ;
199
195
let panic_bounds_check = ty:: Instance :: mono ( this. tcx . tcx , panic_bounds_check) ;
200
196
this. call_function (
201
197
panic_bounds_check,
202
- & [ location . ptr . into ( ) , index. into ( ) , len. into ( ) ] ,
198
+ & [ index. into ( ) , len. into ( ) ] ,
203
199
None ,
204
200
StackPopCleanup :: Goto { ret : None , unwind } ,
205
201
) ?;
0 commit comments