2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:17:20
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
LL | const N: i32 = T::N << 42;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2020-05-08 06:27:36 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:9: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-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:21:13
|
2020-04-29 04:35:45 -05:00
|
|
|
|
|
|
|
|
LL | let _ = x << 42;
|
|
|
|
| ^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:26:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << 8;
|
|
|
|
| ^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:28:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u16 << 16;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:30:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u32 << 32;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:32:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u64 << 64;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:34:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i8 << 8;
|
|
|
|
| ^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:36:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i16 << 16;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:38:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i32 << 32;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:40:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 << 64;
|
|
|
|
| ^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:43:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 >> 8;
|
|
|
|
| ^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:45:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u16 >> 16;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:47:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u32 >> 32;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:49:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u64 >> 64;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:51:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i8 >> 8;
|
|
|
|
| ^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:53:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i16 >> 16;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:55:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i32 >> 32;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:57:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 >> 64;
|
|
|
|
| ^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:61:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = n << 8;
|
|
|
|
| ^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:63:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << -8;
|
|
|
|
| ^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:68:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1u8 << (4+4);
|
|
|
|
| ^^^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:70:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1i64 >> [64][0];
|
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift right with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:76:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1_isize << BITS;
|
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: this arithmetic operation will overflow
|
2020-05-01 05:09:09 -05:00
|
|
|
--> $DIR/lint-exceeding-bitshifts.rs:77:15
|
2020-02-15 04:43:54 -06:00
|
|
|
|
|
|
|
|
LL | let n = 1_usize << BITS;
|
|
|
|
| ^^^^^^^^^^^^^^^ attempt to shift left with overflow
|
|
|
|
|
2020-04-29 04:35:45 -05:00
|
|
|
warning: 24 warnings emitted
|
2020-04-14 18:35:46 -05:00
|
|
|
|