@@ -8,7 +8,6 @@ use rustc_middle::ty;
8
8
use rustc_span:: { source_map:: DUMMY_SP , Span , SpanData , Symbol } ;
9
9
use rustc_target:: abi:: { Align , Size } ;
10
10
11
- use crate :: helpers:: HexRange ;
12
11
use crate :: stacked_borrows:: { diagnostics:: TagHistory , AccessKind } ;
13
12
use crate :: * ;
14
13
@@ -184,14 +183,14 @@ pub fn report_error<'tcx, 'mir>(
184
183
] ;
185
184
match history {
186
185
Some ( TagHistory :: Tagged { tag, created : ( created_range, created_span) , invalidated, protected } ) => {
187
- let msg = format ! ( "{:?} was created by a retag at offsets {}" , tag , HexRange ( * created_range ) ) ;
186
+ let msg = format ! ( "{tag :?} was created by a retag at offsets {created_range:?}" ) ;
188
187
helps. push ( ( Some ( * created_span) , msg) ) ;
189
188
if let Some ( ( invalidated_range, invalidated_span) ) = invalidated {
190
- let msg = format ! ( "{:?} was later invalidated at offsets {}" , tag , HexRange ( * invalidated_range ) ) ;
189
+ let msg = format ! ( "{tag :?} was later invalidated at offsets {invalidated_range:?}" ) ;
191
190
helps. push ( ( Some ( * invalidated_span) , msg) ) ;
192
191
}
193
192
if let Some ( ( protecting_tag, protecting_tag_span, protection_span) ) = protected {
194
- helps. push ( ( Some ( * protecting_tag_span) , format ! ( "{:?} was protected due to {:?} which was created here" , tag , protecting_tag ) ) ) ;
193
+ helps. push ( ( Some ( * protecting_tag_span) , format ! ( "{tag :?} was protected due to {protecting_tag :?} which was created here" ) ) ) ;
195
194
helps. push ( ( Some ( * protection_span) , format ! ( "this protector is live for this call" ) ) ) ;
196
195
}
197
196
}
@@ -448,32 +447,38 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
448
447
for e in diagnostics. drain ( ..) {
449
448
use NonHaltingDiagnostic :: * ;
450
449
let msg = match e {
451
- CreatedPointerTag ( tag, None ) => format ! ( "created tag {tag:?}" ) ,
450
+ CreatedPointerTag ( tag, None ) =>
451
+ format ! ( "created tag {tag:?}" ) ,
452
452
CreatedPointerTag ( tag, Some ( ( alloc_id, range) ) ) =>
453
- format ! ( "created tag {tag:?} at {alloc_id:?}{}" , HexRange ( range ) ) ,
453
+ format ! ( "created tag {tag:?} at {alloc_id:?}{range:?}" ) ,
454
454
PoppedPointerTag ( item, tag) =>
455
455
match tag {
456
456
None =>
457
457
format ! (
458
- "popped tracked tag for item {:?} due to deallocation" ,
459
- item
458
+ "popped tracked tag for item {item:?} due to deallocation" ,
460
459
) ,
461
460
Some ( ( tag, access) ) => {
462
461
format ! (
463
- "popped tracked tag for item {:?} due to {:?} access for {:?}" ,
464
- item, access, tag
462
+ "popped tracked tag for item {item:?} due to {access:?} access for {tag:?}" ,
465
463
)
466
464
}
467
465
} ,
468
- CreatedCallId ( id) => format ! ( "function call with id {id}" ) ,
466
+ CreatedCallId ( id) =>
467
+ format ! ( "function call with id {id}" ) ,
469
468
CreatedAlloc ( AllocId ( id) , size, align, kind) =>
470
- format ! ( "created {kind} allocation of {} bytes (alignment {} bytes) with id {id}" , size. bytes( ) , align. bytes( ) ) ,
471
- FreedAlloc ( AllocId ( id) ) => format ! ( "freed allocation with id {id}" ) ,
469
+ format ! (
470
+ "created {kind} allocation of {size} bytes (alignment {align} bytes) with id {id}" ,
471
+ size = size. bytes( ) ,
472
+ align = align. bytes( ) ,
473
+ ) ,
474
+ FreedAlloc ( AllocId ( id) ) =>
475
+ format ! ( "freed allocation with id {id}" ) ,
472
476
RejectedIsolatedOp ( ref op) =>
473
477
format ! ( "{op} was made to return an error due to isolation" ) ,
474
478
ProgressReport =>
475
479
format ! ( "progress report: current operation being executed is here" ) ,
476
- Int2Ptr { .. } => format ! ( "integer-to-pointer cast" ) ,
480
+ Int2Ptr { .. } =>
481
+ format ! ( "integer-to-pointer cast" ) ,
477
482
} ;
478
483
479
484
let ( title, diag_level) = match e {
0 commit comments