]> git.lizzy.rs Git - rust.git/commitdiff
for alignment errors, note that there might be false positives
authorRalf Jung <post@ralfj.de>
Mon, 13 Apr 2020 07:18:11 +0000 (09:18 +0200)
committerRalf Jung <post@ralfj.de>
Mon, 13 Apr 2020 07:18:11 +0000 (09:18 +0200)
src/diagnostics.rs

index 90e532321e4049254a8baca5150a649b3838b858..c387eed5c41cae20022db68de4aa3473c2780e96 100644 (file)
@@ -93,6 +93,11 @@ pub fn report_error<'tcx, 'mir>(
                     vec![format!("make sure to use a Miri sysroot, which you can prepare with `cargo miri setup`")],
                 Unsupported(_) =>
                     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")],
+                UndefinedBehavior(UndefinedBehaviorInfo::AlignmentCheckFailed { .. }) =>
+                    vec![
+                        format!("this usually indicates that your program performed an invalid operation and caused Undefined Behavior"),
+                        format!("but alignment errors can also be false positives, see https://github.com/rust-lang/miri/issues/1074"),
+                    ],
                 UndefinedBehavior(_) =>
                     vec![
                         format!("this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior"),