about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGurinder Singh <frederick.the.fool@gmail.com>2024-02-17 10:44:46 +0530
committerGurinder Singh <frederick.the.fool@gmail.com>2024-02-17 10:44:46 +0530
commit5010ca001cb7cad425b906136fe251e8d8192b2e (patch)
tree08851c04b747f9144044e26f2960381c2c2febf3 /src
parent405b22f1a3a39eef5f4698b3662097c8a4f6f5d0 (diff)
Enable `ConstPropLint` for promoteds
This fixes the issue wherein the lint didn't fire for promoteds
in the case of SHL/SHR operators in non-optimized builds
and all arithmetic operators in optimized builds
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass/overflow_checks_off.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/overflow_checks_off.rs b/src/tools/miri/tests/pass/overflow_checks_off.rs
index 79aa510ef97..7b9d4f8fff5 100644
--- a/src/tools/miri/tests/pass/overflow_checks_off.rs
+++ b/src/tools/miri/tests/pass/overflow_checks_off.rs
@@ -1,12 +1,17 @@
 //@compile-flags: -C overflow-checks=off
 
 // Check that we correctly implement the intended behavior of these operators
-// when they are not being overflow-checked.
+// when they are not being overflow-checked at runtime.
 
 // FIXME: if we call the functions in `std::ops`, we still get the panics.
 // Miri does not implement the codegen-time hack that backs `#[rustc_inherit_overflow_checks]`.
 // use std::ops::*;
 
+
+// Disable _compile-time_ overflow linting
+// so that we can test runtime overflow checks
+ #![allow(arithmetic_overflow)]
+
 fn main() {
     assert_eq!(-{ -0x80i8 }, -0x80);