File tree Expand file tree Collapse file tree 5 files changed +57
-0
lines changed Expand file tree Collapse file tree 5 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ error: this arithmetic operation will overflow
2
+ --> $DIR/issue-69020.rs:15:20
3
+ |
4
+ LL | const N: i32 = -i32::MIN + T::N;
5
+ | ^^^^^^^^^ attempt to negate with overflow
6
+ |
7
+ = note: `#[deny(overflow)]` on by default
8
+
9
+ error: aborting due to previous error
10
+
Original file line number Diff line number Diff line change
1
+ error: this arithmetic operation will overflow
2
+ --> $DIR/issue-69020.rs:15:20
3
+ |
4
+ LL | const N: i32 = -i32::MIN + T::N;
5
+ | ^^^^^^^^^ attempt to negate with overflow
6
+ |
7
+ = note: `#[deny(overflow)]` on by default
8
+
9
+ error: aborting due to previous error
10
+
Original file line number Diff line number Diff line change
1
+ error: this arithmetic operation will overflow
2
+ --> $DIR/issue-69020.rs:15:20
3
+ |
4
+ LL | const N: i32 = -i32::MIN + T::N;
5
+ | ^^^^^^^^^ attempt to negate with overflow
6
+ |
7
+ = note: `#[deny(overflow)]` on by default
8
+
9
+ error: aborting due to previous error
10
+
Original file line number Diff line number Diff line change
1
+ error: this arithmetic operation will overflow
2
+ --> $DIR/issue-69020.rs:15:20
3
+ |
4
+ LL | const N: i32 = -i32::MIN + T::N;
5
+ | ^^^^^^^^^ attempt to negate with overflow
6
+ |
7
+ = note: `#[deny(overflow)]` on by default
8
+
9
+ error: aborting due to previous error
10
+
Original file line number Diff line number Diff line change
1
+ // revisions: default noopt opt opt_with_overflow_checks
2
+ //[noopt]compile-flags: -C opt-level=0
3
+ //[opt]compile-flags: -O
4
+ //[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
5
+
6
+ #![ crate_type="lib" ]
7
+
8
+ use std:: i32;
9
+
10
+ pub trait Foo {
11
+ const N : i32 ;
12
+ }
13
+
14
+ impl < T : Foo > Foo for Vec < T > {
15
+ const N : i32 = -i32:: MIN + T :: N ;
16
+ //~^ ERROR arithmetic operation will overflow
17
+ }
You can’t perform that action at this time.
0 commit comments