]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-fail/overflowing-sub.rs
Add #[rustc_no_mir] to make tests pass with -Z orbit.
[rust.git] / src / test / run-fail / overflowing-sub.rs
index b089dccbaa52f0c54b18abcb4ec65377ccd0c383..ce243a50e0b66f2065b84c038af2279041d09404 100644 (file)
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-pretty : (#23623) problems when  ending with // comments
+
 // error-pattern:thread '<main>' panicked at 'arithmetic operation overflowed'
 // compile-flags: -C debug-assertions
 
-// (Work around constant-evaluation)
-fn value() -> u8 { 42 }
-
+#![feature(rustc_attrs)]
+#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
 fn main() {
-    let _x = value() - (value() + 1);
+    let _x = 42u8 - (42u8 + 1);
 }