summary refs log tree commit diff
path: root/src/test/ui/consts/const-err2.opt.stderr
blob: 5aeeec4bd1435afce765d3fd62d97bd56a64daca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:19:13
   |
LL |     let a = -std::i8::MIN;
   |             ^^^^^^^^^^^^^ attempt to negate with overflow
   |
   = note: `#[deny(arithmetic_overflow)]` on by default

error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:21:18
   |
LL |     let a_i128 = -std::i128::MIN;
   |                  ^^^^^^^^^^^^^^^ attempt to negate with overflow

error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:23:13
   |
LL |     let b = 200u8 + 200u8 + 200u8;
   |             ^^^^^^^^^^^^^ attempt to add with overflow

error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:25:18
   |
LL |     let b_i128 = std::i128::MIN - std::i128::MAX;
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow

error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:27:13
   |
LL |     let c = 200u8 * 4;
   |             ^^^^^^^^^ attempt to multiply with overflow

error: this arithmetic operation will overflow
  --> $DIR/const-err2.rs:29:13
   |
LL |     let d = 42u8 - (42u8 + 1);
   |             ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow

error: this operation will panic at runtime
  --> $DIR/const-err2.rs:31:14
   |
LL |     let _e = [5u8][1];
   |              ^^^^^^^^ index out of bounds: the len is 1 but the index is 1
   |
   = note: `#[deny(unconditional_panic)]` on by default

error: aborting due to 7 previous errors