@@ -306,7 +306,7 @@ pub fn report_error<'tcx, 'mir>(
306306 msg. insert ( 0 , e. to_string ( ) ) ;
307307 report_msg (
308308 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 ( ) } ,
310310 msg,
311311 vec ! [ ] ,
312312 helps,
@@ -359,7 +359,7 @@ pub fn report_leaks<'mir, 'tcx>(
359359 any_pruned |= pruned;
360360 report_msg (
361361 DiagLevel :: Error ,
362- & format ! (
362+ format ! (
363363 "memory leaked: {id:?} ({}, size: {:?}, align: {:?}), allocated here:" ,
364364 kind,
365365 alloc. size( ) . bytes( ) ,
@@ -386,7 +386,7 @@ pub fn report_leaks<'mir, 'tcx>(
386386/// additional `span_label` or `note` call.
387387pub fn report_msg < ' tcx > (
388388 diag_level : DiagLevel ,
389- title : & str ,
389+ title : String ,
390390 span_msg : Vec < String > ,
391391 notes : Vec < ( Option < SpanData > , String ) > ,
392392 helps : Vec < ( Option < SpanData > , String ) > ,
@@ -463,15 +463,16 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
463463 let ( stacktrace, _was_pruned) = prune_stacktrace ( stacktrace, self ) ;
464464
465465 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 ) ,
468469 CreatedPointerTag ( ..)
469470 | PoppedPointerTag ( ..)
470471 | CreatedCallId ( ..)
471472 | CreatedAlloc ( ..)
472473 | FreedAlloc ( ..)
473474 | ProgressReport { .. }
474- | WeakMemoryOutdatedLoad => ( "tracking was triggered" , DiagLevel :: Note ) ,
475+ | WeakMemoryOutdatedLoad => ( "tracking was triggered" . to_string ( ) , DiagLevel :: Note ) ,
475476 } ;
476477
477478 let msg = match & e {
@@ -571,7 +572,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
571572 let stacktrace = this. generate_stacktrace ( ) ;
572573 report_msg (
573574 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 ( ) ,
575576 vec ! [ ] ,
576577 vec ! [ ] ,
577578 vec ! [ ] ,
0 commit comments