@@ -306,7 +306,7 @@ pub fn report_error<'tcx, 'mir>(
306
306
msg. insert ( 0 , e. to_string ( ) ) ;
307
307
report_msg (
308
308
DiagLevel :: Error ,
309
- & if let Some ( title) = title { format ! ( "{title}: {}" , msg[ 0 ] ) } else { msg[ 0 ] . clone ( ) } ,
309
+ if let Some ( title) = title { format ! ( "{title}: {}" , msg[ 0 ] ) } else { msg[ 0 ] . clone ( ) } ,
310
310
msg,
311
311
vec ! [ ] ,
312
312
helps,
@@ -359,7 +359,7 @@ pub fn report_leaks<'mir, 'tcx>(
359
359
any_pruned |= pruned;
360
360
report_msg (
361
361
DiagLevel :: Error ,
362
- & format ! (
362
+ format ! (
363
363
"memory leaked: {id:?} ({}, size: {:?}, align: {:?}), allocated here:" ,
364
364
kind,
365
365
alloc. size( ) . bytes( ) ,
@@ -386,7 +386,7 @@ pub fn report_leaks<'mir, 'tcx>(
386
386
/// additional `span_label` or `note` call.
387
387
pub fn report_msg < ' tcx > (
388
388
diag_level : DiagLevel ,
389
- title : & str ,
389
+ title : String ,
390
390
span_msg : Vec < String > ,
391
391
notes : Vec < ( Option < SpanData > , String ) > ,
392
392
helps : Vec < ( Option < SpanData > , String ) > ,
@@ -463,15 +463,16 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
463
463
let ( stacktrace, _was_pruned) = prune_stacktrace ( stacktrace, self ) ;
464
464
465
465
let ( title, diag_level) = match & e {
466
- RejectedIsolatedOp ( _) => ( "operation rejected by isolation" , DiagLevel :: Warning ) ,
467
- Int2Ptr { .. } => ( "integer-to-pointer cast" , DiagLevel :: Warning ) ,
466
+ RejectedIsolatedOp ( _) =>
467
+ ( "operation rejected by isolation" . to_string ( ) , DiagLevel :: Warning ) ,
468
+ Int2Ptr { .. } => ( "integer-to-pointer cast" . to_string ( ) , DiagLevel :: Warning ) ,
468
469
CreatedPointerTag ( ..)
469
470
| PoppedPointerTag ( ..)
470
471
| CreatedCallId ( ..)
471
472
| CreatedAlloc ( ..)
472
473
| FreedAlloc ( ..)
473
474
| ProgressReport { .. }
474
- | WeakMemoryOutdatedLoad => ( "tracking was triggered" , DiagLevel :: Note ) ,
475
+ | WeakMemoryOutdatedLoad => ( "tracking was triggered" . to_string ( ) , DiagLevel :: Note ) ,
475
476
} ;
476
477
477
478
let msg = match & e {
@@ -571,7 +572,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
571
572
let stacktrace = this. generate_stacktrace ( ) ;
572
573
report_msg (
573
574
DiagLevel :: Note ,
574
- "the place in the program where the ICE was triggered" ,
575
+ "the place in the program where the ICE was triggered" . to_string ( ) ,
575
576
vec ! [ ] ,
576
577
vec ! [ ] ,
577
578
vec ! [ ] ,
0 commit comments