@@ -102,7 +102,7 @@ pub fn report_error<'tcx, 'mir>(
102
102
103
103
e. print_backtrace ( ) ;
104
104
let msg = e. to_string ( ) ;
105
- report_msg ( ecx, & format ! ( "{}: {}" , title, msg) , msg, & helps, true )
105
+ report_msg ( ecx, & format ! ( "{}: {}" , title, msg) , msg, helps, true )
106
106
}
107
107
108
108
/// Report an error or note (depending on the `error` argument) at the current frame's current statement.
@@ -111,7 +111,7 @@ fn report_msg<'tcx, 'mir>(
111
111
ecx : & InterpCx < ' mir , ' tcx , Evaluator < ' tcx > > ,
112
112
title : & str ,
113
113
span_msg : String ,
114
- helps : & [ String ] ,
114
+ mut helps : Vec < String > ,
115
115
error : bool ,
116
116
) -> Option < i64 > {
117
117
let span = if let Some ( frame) = ecx. stack ( ) . last ( ) {
@@ -125,8 +125,12 @@ fn report_msg<'tcx, 'mir>(
125
125
ecx. tcx . sess . diagnostic ( ) . span_note_diag ( span, title)
126
126
} ;
127
127
err. span_label ( span, span_msg) ;
128
- for help in helps {
129
- err. help ( help) ;
128
+ if !helps. is_empty ( ) {
129
+ // Add visual separator before backtrace.
130
+ helps. last_mut ( ) . unwrap ( ) . push_str ( "\n " ) ;
131
+ for help in helps {
132
+ err. help ( & help) ;
133
+ }
130
134
}
131
135
// Add backtrace
132
136
let frames = ecx. generate_stacktrace ( ) ;
@@ -178,7 +182,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
178
182
CreatedAlloc ( AllocId ( id) ) =>
179
183
format ! ( "created allocation with id {}" , id) ,
180
184
} ;
181
- report_msg ( this, "tracking was triggered" , msg, & [ ] , false ) ;
185
+ report_msg ( this, "tracking was triggered" , msg, vec ! [ ] , false ) ;
182
186
}
183
187
} ) ;
184
188
}
0 commit comments