We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20b1e05 commit 4445e46Copy full SHA for 4445e46
src/test/ui/const_prop/inline_spans.rs
@@ -0,0 +1,14 @@
1
+// build-fail
2
+// compile-flags: -Zmir-opt-level=2
3
+
4
+#![deny(warnings)]
5
6
+fn main() {
7
+ let _ = add(u8::MAX, 1);
8
+}
9
10
+#[inline(always)]
11
+fn add(x: u8, y: u8) -> u8 {
12
+ x + y
13
+ //~^ ERROR this arithmetic operation will overflow
14
src/test/ui/const_prop/inline_spans.stderr
@@ -0,0 +1,10 @@
+error: this arithmetic operation will overflow
+ --> $DIR/inline_spans.rs:12:5
+ |
+LL | x + y
+ | ^^^^^ attempt to compute `u8::MAX + 1_u8` which would overflow
+ = note: `#[deny(arithmetic_overflow)]` on by default
+error: aborting due to previous error
0 commit comments