mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
47 lines
1.5 KiB
Text
47 lines
1.5 KiB
Text
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:16:5
|
|
|
|
|
LL | 1 << 2 + 3;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
|
|
|
|
|
= note: `-D clippy::precedence` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::precedence)]`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:17:5
|
|
|
|
|
LL | 1 + 2 << 3;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:18:5
|
|
|
|
|
LL | 4 >> 1 + 1;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `4 >> (1 + 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:19:5
|
|
|
|
|
LL | 1 + 3 >> 2;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 3) >> 2`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:20:5
|
|
|
|
|
LL | 1 ^ 1 - 1;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `1 ^ (1 - 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:21:5
|
|
|
|
|
LL | 3 | 2 - 1;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 | (2 - 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> tests/ui/precedence.rs:22:5
|
|
|
|
|
LL | 3 & 5 - 2;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 & (5 - 2)`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|