2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:18:20
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
LL | const N: i32 = T::N << 42;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 42_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:10:9
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
LL | #![warn(arithmetic_overflow, const_err)]
|
2020-02-15 04:43:54 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:22:13
|
2020-04-29 04:35:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = x << 42;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^ attempt to shift left by 42_i32 which would overflow
|
2020-04-29 04:35:45 -05:00
|
|
|
|
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:27:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << 8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^ attempt to shift left by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:29:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u16 << 16;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:31:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u32 << 32;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:33:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u64 << 64;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:35:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i8 << 8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^ attempt to shift left by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:37:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i16 << 16;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 16_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:39:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i32 << 32;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 32_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:41:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 << 64;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift left by 64_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:44:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 >> 8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^ attempt to shift right by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:46:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u16 >> 16;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:48:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u32 >> 32;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:50:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u64 >> 64;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:52:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i8 >> 8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^ attempt to shift right by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:54:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i16 >> 16;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 16_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:56:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i32 >> 32;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 32_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:58:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 >> 64;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:62:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = n << 8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^ attempt to shift left by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:64:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << -8;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^ attempt to shift left by -8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:69:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << (4+4);
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^^^ attempt to shift left by 8_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:71:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 >> [64][0];
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift right by 64_i32 which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:77:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1_isize << BITS;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-06-19 11:57:15 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:78:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1_usize << BITS;
|
2020-06-19 11:57:15 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift left by %BITS% which would overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: 24 warnings emitted
|
2020-04-14 18:35:46 -05:00
|
|
|
|