fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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