@@ -8,7 +8,6 @@ use rustc_middle::ty;
88use rustc_span:: { source_map:: DUMMY_SP , Span , SpanData , Symbol } ;
99use rustc_target:: abi:: { Align , Size } ;
1010
11- use crate :: helpers:: HexRange ;
1211use crate :: stacked_borrows:: { diagnostics:: TagHistory , AccessKind } ;
1312use crate :: * ;
1413
@@ -184,14 +183,14 @@ pub fn report_error<'tcx, 'mir>(
184183 ] ;
185184 match history {
186185 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:?}" ) ;
188187 helps. push ( ( Some ( * created_span) , msg) ) ;
189188 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:?}" ) ;
191190 helps. push ( ( Some ( * invalidated_span) , msg) ) ;
192191 }
193192 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" ) ) ) ;
195194 helps. push ( ( Some ( * protection_span) , format ! ( "this protector is live for this call" ) ) ) ;
196195 }
197196 }
@@ -448,32 +447,38 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
448447 for e in diagnostics. drain ( ..) {
449448 use NonHaltingDiagnostic :: * ;
450449 let msg = match e {
451- CreatedPointerTag ( tag, None ) => format ! ( "created tag {tag:?}" ) ,
450+ CreatedPointerTag ( tag, None ) =>
451+ format ! ( "created tag {tag:?}" ) ,
452452 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:?}" ) ,
454454 PoppedPointerTag ( item, tag) =>
455455 match tag {
456456 None =>
457457 format ! (
458- "popped tracked tag for item {:?} due to deallocation" ,
459- item
458+ "popped tracked tag for item {item:?} due to deallocation" ,
460459 ) ,
461460 Some ( ( tag, access) ) => {
462461 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:?}" ,
465463 )
466464 }
467465 } ,
468- CreatedCallId ( id) => format ! ( "function call with id {id}" ) ,
466+ CreatedCallId ( id) =>
467+ format ! ( "function call with id {id}" ) ,
469468 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}" ) ,
472476 RejectedIsolatedOp ( ref op) =>
473477 format ! ( "{op} was made to return an error due to isolation" ) ,
474478 ProgressReport =>
475479 format ! ( "progress report: current operation being executed is here" ) ,
476- Int2Ptr { .. } => format ! ( "integer-to-pointer cast" ) ,
480+ Int2Ptr { .. } =>
481+ format ! ( "integer-to-pointer cast" ) ,
477482 } ;
478483
479484 let ( title, diag_level) = match e {
0 commit comments