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