Skip to content

Commit fbbd442

Browse files
committed
Auto merge of #1328 - RalfJung:align-false-pos, r=RalfJung
for alignment errors, note that there might be false positives Cc @shepmaster ``` error: Undefined Behavior: accessing memory with alignment 1, but alignment 8 is required --> tests/compile-fail/unaligned_pointers/alignment.rs:8:9 | 8 | *y_ptr = 42; | ^^^^^^^^^^^ accessing memory with alignment 1, but alignment 8 is required | = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior = help: but alignment errors can also be false positives, see #1074 ```
2 parents 4545eff + 75297d3 commit fbbd442

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/diagnostics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ pub fn report_error<'tcx, 'mir>(
9393
vec![format!("make sure to use a Miri sysroot, which you can prepare with `cargo miri setup`")],
9494
Unsupported(_) =>
9595
vec![format!("this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support")],
96+
UndefinedBehavior(UndefinedBehaviorInfo::AlignmentCheckFailed { .. }) =>
97+
vec![
98+
format!("this usually indicates that your program performed an invalid operation and caused Undefined Behavior"),
99+
format!("but alignment errors can also be false positives, see https://github.com/rust-lang/miri/issues/1074"),
100+
],
96101
UndefinedBehavior(_) =>
97102
vec![
98103
format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior"),

0 commit comments

Comments
 (0)