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