You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Attempts to prune a stacktrace to omit the Rust runtime, and returns a bool indicating if any
144
153
/// frames were pruned. If the stacktrace does not have any local frames, we conclude that it must
145
154
/// be pointing to a problem in the Rust runtime itself, and do not prune it at all.
@@ -228,38 +237,38 @@ pub fn report_error<'tcx>(
228
237
let helps = match info {
229
238
UnsupportedInIsolation(_) =>
230
239
vec![
231
-
(None, format!("set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation;")),
232
-
(None, format!("or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning")),
240
+
note!("set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation;"),
241
+
note!("or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning"),
233
242
],
234
243
UnsupportedForeignItem(_) => {
235
244
vec![
236
-
(None, format!("if this is a basic API commonly used on this target, please report an issue with Miri")),
237
-
(None, format!("however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases")),
245
+
note!("if this is a basic API commonly used on this target, please report an issue with Miri"),
246
+
note!("however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases"),
238
247
]
239
248
}
240
249
StackedBorrowsUb{ help, history, .. } => {
241
250
msg.extend(help.clone());
242
251
letmut helps = vec![
243
-
(None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental")),
244
-
(None, format!("see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information")),
252
+
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental"),
253
+
note!("see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information"),
(None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental"))
268
+
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental")
helps.push((None,format!("see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model")));
290
+
helps.push(note!("{extra}"));
291
+
helps.push(note!("see https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#memory-model-for-atomic-accesses for more information about the Rust memory model"));
283
292
}
284
293
if*retag_explain {
285
-
helps.push((None,"retags occur on all (re)borrows and as well as when references are copied or moved".to_owned()));
286
-
helps.push((None,"retags permit optimizations that insert speculative reads or writes".to_owned()));
287
-
helps.push((None,"therefore from the perspective of data races, a retag has the same implications as a read or write".to_owned()));
294
+
helps.push(note!("retags occur on all (re)borrows and as well as when references are copied or moved"));
295
+
helps.push(note!("retags permit optimizations that insert speculative reads or writes"));
296
+
helps.push(note!("therefore from the perspective of data races, a retag has the same implications as a read or write"));
288
297
}
289
-
helps.push((None,format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")));
290
-
helps.push((None,format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")));
298
+
helps.push(note!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior"));
299
+
helps.push(note!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information"));
291
300
helps
292
301
}
293
302
,
@@ -332,32 +341,32 @@ pub fn report_error<'tcx>(
332
341
let helps = match e.kind(){
333
342
Unsupported(_) =>
334
343
vec![
335
-
(None, format!("this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support")),
344
+
note!("this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support"),
336
345
],
337
346
UndefinedBehavior(AlignmentCheckFailed{ .. })
338
347
if ecx.machine.check_alignment == AlignmentCheck::Symbolic
339
348
=>
340
349
vec![
341
-
(None, format!("this usually indicates that your program performed an invalid operation and caused Undefined Behavior")),
342
-
(None, format!("but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives")),
350
+
note!("this usually indicates that your program performed an invalid operation and caused Undefined Behavior"),
351
+
note!("but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives"),
343
352
],
344
353
UndefinedBehavior(info) => {
345
354
letmut helps = vec![
346
-
(None, format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior")),
347
-
(None, format!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information")),
355
+
note!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior"),
356
+
note!("see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information"),
// It is important that each progress report is slightly different, since
643
-
// identical diagnostics are being deduplicated.
644
-
vec![(None, format!("so far, {block_count} basic blocks have been executed"))]
651
+
vec![note!("so far, {block_count} basic blocks have been executed")]
645
652
}
646
653
_ => vec![],
647
654
};
648
655
649
656
let helps = match&e {
650
657
Int2Ptr{details:true} => {
651
658
letmut v = vec![
652
-
(
653
-
None,
654
-
format!(
655
-
"this program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`, which means that Miri might miss pointer bugs in this program"
656
-
),
659
+
note!(
660
+
"this program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`, which means that Miri might miss pointer bugs in this program"
657
661
),
658
-
(
659
-
None,
660
-
format!(
661
-
"see https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation"
662
-
),
662
+
note!(
663
+
"see https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation"
663
664
),
664
-
(
665
-
None,
666
-
format!(
667
-
"to ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead"
668
-
),
665
+
note!(
666
+
"to ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead"
669
667
),
670
-
(
671
-
None,
672
-
format!(
673
-
"you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics"
674
-
),
668
+
note!(
669
+
"you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics"
0 commit comments