|
1 | | -warning: this arithmetic operation will overflow |
2 | | - --> $DIR/lint-exceeding-bitshifts.rs:18:20 |
| 1 | +error: this arithmetic operation will overflow |
| 2 | + --> $DIR/lint-exceeding-bitshifts.rs:22:13 |
3 | 3 | | |
4 | | -LL | const N: i32 = T::N << 42; |
5 | | - | ^^^^^^^^^^ attempt to shift left with overflow |
| 4 | +LL | let _ = x << 42; |
| 5 | + | ^^^^^^^ attempt to shift left with overflow |
6 | 6 | | |
7 | 7 | note: the lint level is defined here |
8 | 8 | --> $DIR/lint-exceeding-bitshifts.rs:9:9 |
9 | 9 | | |
10 | | -LL | #![warn(arithmetic_overflow, const_err)] |
| 10 | +LL | #![deny(arithmetic_overflow, const_err)] |
11 | 11 | | ^^^^^^^^^^^^^^^^^^^ |
12 | 12 |
|
13 | | -warning: this arithmetic operation will overflow |
14 | | - --> $DIR/lint-exceeding-bitshifts.rs:22:13 |
15 | | - | |
16 | | -LL | let _ = x << 42; |
17 | | - | ^^^^^^^ attempt to shift left with overflow |
18 | | - |
19 | | -warning: this arithmetic operation will overflow |
| 13 | +error: this arithmetic operation will overflow |
20 | 14 | --> $DIR/lint-exceeding-bitshifts.rs:27:15 |
21 | 15 | | |
22 | 16 | LL | let n = 1u8 << 8; |
23 | 17 | | ^^^^^^^^ attempt to shift left with overflow |
24 | 18 |
|
25 | | -warning: this arithmetic operation will overflow |
| 19 | +error: this arithmetic operation will overflow |
26 | 20 | --> $DIR/lint-exceeding-bitshifts.rs:29:15 |
27 | 21 | | |
28 | 22 | LL | let n = 1u16 << 16; |
29 | 23 | | ^^^^^^^^^^ attempt to shift left with overflow |
30 | 24 |
|
31 | | -warning: this arithmetic operation will overflow |
| 25 | +error: this arithmetic operation will overflow |
32 | 26 | --> $DIR/lint-exceeding-bitshifts.rs:31:15 |
33 | 27 | | |
34 | 28 | LL | let n = 1u32 << 32; |
35 | 29 | | ^^^^^^^^^^ attempt to shift left with overflow |
36 | 30 |
|
37 | | -warning: this arithmetic operation will overflow |
| 31 | +error: this arithmetic operation will overflow |
38 | 32 | --> $DIR/lint-exceeding-bitshifts.rs:33:15 |
39 | 33 | | |
40 | 34 | LL | let n = 1u64 << 64; |
41 | 35 | | ^^^^^^^^^^ attempt to shift left with overflow |
42 | 36 |
|
43 | | -warning: this arithmetic operation will overflow |
| 37 | +error: this arithmetic operation will overflow |
44 | 38 | --> $DIR/lint-exceeding-bitshifts.rs:35:15 |
45 | 39 | | |
46 | 40 | LL | let n = 1i8 << 8; |
47 | 41 | | ^^^^^^^^ attempt to shift left with overflow |
48 | 42 |
|
49 | | -warning: this arithmetic operation will overflow |
| 43 | +error: this arithmetic operation will overflow |
50 | 44 | --> $DIR/lint-exceeding-bitshifts.rs:37:15 |
51 | 45 | | |
52 | 46 | LL | let n = 1i16 << 16; |
53 | 47 | | ^^^^^^^^^^ attempt to shift left with overflow |
54 | 48 |
|
55 | | -warning: this arithmetic operation will overflow |
| 49 | +error: this arithmetic operation will overflow |
56 | 50 | --> $DIR/lint-exceeding-bitshifts.rs:39:15 |
57 | 51 | | |
58 | 52 | LL | let n = 1i32 << 32; |
59 | 53 | | ^^^^^^^^^^ attempt to shift left with overflow |
60 | 54 |
|
61 | | -warning: this arithmetic operation will overflow |
| 55 | +error: this arithmetic operation will overflow |
62 | 56 | --> $DIR/lint-exceeding-bitshifts.rs:41:15 |
63 | 57 | | |
64 | 58 | LL | let n = 1i64 << 64; |
65 | 59 | | ^^^^^^^^^^ attempt to shift left with overflow |
66 | 60 |
|
67 | | -warning: this arithmetic operation will overflow |
| 61 | +error: this arithmetic operation will overflow |
68 | 62 | --> $DIR/lint-exceeding-bitshifts.rs:44:15 |
69 | 63 | | |
70 | 64 | LL | let n = 1u8 >> 8; |
71 | 65 | | ^^^^^^^^ attempt to shift right with overflow |
72 | 66 |
|
73 | | -warning: this arithmetic operation will overflow |
| 67 | +error: this arithmetic operation will overflow |
74 | 68 | --> $DIR/lint-exceeding-bitshifts.rs:46:15 |
75 | 69 | | |
76 | 70 | LL | let n = 1u16 >> 16; |
77 | 71 | | ^^^^^^^^^^ attempt to shift right with overflow |
78 | 72 |
|
79 | | -warning: this arithmetic operation will overflow |
| 73 | +error: this arithmetic operation will overflow |
80 | 74 | --> $DIR/lint-exceeding-bitshifts.rs:48:15 |
81 | 75 | | |
82 | 76 | LL | let n = 1u32 >> 32; |
83 | 77 | | ^^^^^^^^^^ attempt to shift right with overflow |
84 | 78 |
|
85 | | -warning: this arithmetic operation will overflow |
| 79 | +error: this arithmetic operation will overflow |
86 | 80 | --> $DIR/lint-exceeding-bitshifts.rs:50:15 |
87 | 81 | | |
88 | 82 | LL | let n = 1u64 >> 64; |
89 | 83 | | ^^^^^^^^^^ attempt to shift right with overflow |
90 | 84 |
|
91 | | -warning: this arithmetic operation will overflow |
| 85 | +error: this arithmetic operation will overflow |
92 | 86 | --> $DIR/lint-exceeding-bitshifts.rs:52:15 |
93 | 87 | | |
94 | 88 | LL | let n = 1i8 >> 8; |
95 | 89 | | ^^^^^^^^ attempt to shift right with overflow |
96 | 90 |
|
97 | | -warning: this arithmetic operation will overflow |
| 91 | +error: this arithmetic operation will overflow |
98 | 92 | --> $DIR/lint-exceeding-bitshifts.rs:54:15 |
99 | 93 | | |
100 | 94 | LL | let n = 1i16 >> 16; |
101 | 95 | | ^^^^^^^^^^ attempt to shift right with overflow |
102 | 96 |
|
103 | | -warning: this arithmetic operation will overflow |
| 97 | +error: this arithmetic operation will overflow |
104 | 98 | --> $DIR/lint-exceeding-bitshifts.rs:56:15 |
105 | 99 | | |
106 | 100 | LL | let n = 1i32 >> 32; |
107 | 101 | | ^^^^^^^^^^ attempt to shift right with overflow |
108 | 102 |
|
109 | | -warning: this arithmetic operation will overflow |
| 103 | +error: this arithmetic operation will overflow |
110 | 104 | --> $DIR/lint-exceeding-bitshifts.rs:58:15 |
111 | 105 | | |
112 | 106 | LL | let n = 1i64 >> 64; |
113 | 107 | | ^^^^^^^^^^ attempt to shift right with overflow |
114 | 108 |
|
115 | | -warning: this arithmetic operation will overflow |
| 109 | +error: this arithmetic operation will overflow |
116 | 110 | --> $DIR/lint-exceeding-bitshifts.rs:62:15 |
117 | 111 | | |
118 | 112 | LL | let n = n << 8; |
119 | 113 | | ^^^^^^ attempt to shift left with overflow |
120 | 114 |
|
121 | | -warning: this arithmetic operation will overflow |
| 115 | +error: this arithmetic operation will overflow |
122 | 116 | --> $DIR/lint-exceeding-bitshifts.rs:64:15 |
123 | 117 | | |
124 | 118 | LL | let n = 1u8 << -8; |
125 | 119 | | ^^^^^^^^^ attempt to shift left with overflow |
126 | 120 |
|
127 | | -warning: this arithmetic operation will overflow |
| 121 | +error: this arithmetic operation will overflow |
128 | 122 | --> $DIR/lint-exceeding-bitshifts.rs:69:15 |
129 | 123 | | |
130 | 124 | LL | let n = 1u8 << (4+4); |
131 | 125 | | ^^^^^^^^^^^^ attempt to shift left with overflow |
132 | 126 |
|
133 | | -warning: this arithmetic operation will overflow |
| 127 | +error: this arithmetic operation will overflow |
134 | 128 | --> $DIR/lint-exceeding-bitshifts.rs:71:15 |
135 | 129 | | |
136 | 130 | LL | let n = 1i64 >> [64][0]; |
137 | 131 | | ^^^^^^^^^^^^^^^ attempt to shift right with overflow |
138 | 132 |
|
139 | | -warning: this arithmetic operation will overflow |
| 133 | +error: this arithmetic operation will overflow |
140 | 134 | --> $DIR/lint-exceeding-bitshifts.rs:77:15 |
141 | 135 | | |
142 | 136 | LL | let n = 1_isize << BITS; |
143 | 137 | | ^^^^^^^^^^^^^^^ attempt to shift left with overflow |
144 | 138 |
|
145 | | -warning: this arithmetic operation will overflow |
| 139 | +error: this arithmetic operation will overflow |
146 | 140 | --> $DIR/lint-exceeding-bitshifts.rs:78:15 |
147 | 141 | | |
148 | 142 | LL | let n = 1_usize << BITS; |
149 | 143 | | ^^^^^^^^^^^^^^^ attempt to shift left with overflow |
150 | 144 |
|
151 | | -warning: 24 warnings emitted |
| 145 | +error: aborting due to 23 previous errors |
152 | 146 |
|
0 commit comments