File tree 1 file changed +5
-1
lines changed
src/tools/miri/src/borrow_tracker 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
346
346
347
347
fn print_borrow_state ( & mut self , alloc_id : AllocId , show_unnamed : bool ) -> InterpResult < ' tcx > {
348
348
let this = self . eval_context_mut ( ) ;
349
- let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
349
+ let Some ( borrow_tracker) = & this. machine . borrow_tracker else {
350
+ eprintln ! ( "attempted to print borrow state, but no borrow state is being tracked" ) ;
351
+ return Ok ( ( ) ) ;
352
+ } ;
353
+ let method = borrow_tracker. borrow ( ) . borrow_tracker_method ;
350
354
match method {
351
355
BorrowTrackerMethod :: StackedBorrows => this. print_stacks ( alloc_id) ,
352
356
BorrowTrackerMethod :: TreeBorrows => this. print_tree ( alloc_id, show_unnamed) ,
You can’t perform that action at this time.
0 commit comments