mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
59 lines
1.8 KiB
Plaintext
59 lines
1.8 KiB
Plaintext
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:24:5
|
|
|
|
|
24 | 1 << 2 + 3;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
|
|
|
|
|
= note: `-D clippy::precedence` implied by `-D warnings`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:25:5
|
|
|
|
|
25 | 1 + 2 << 3;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:26:5
|
|
|
|
|
26 | 4 >> 1 + 1;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `4 >> (1 + 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:27:5
|
|
|
|
|
27 | 1 + 3 >> 2;
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 3) >> 2`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:28:5
|
|
|
|
|
28 | 1 ^ 1 - 1;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `1 ^ (1 - 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:29:5
|
|
|
|
|
29 | 3 | 2 - 1;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 | (2 - 1)`
|
|
|
|
error: operator precedence can trip the unwary
|
|
--> $DIR/precedence.rs:30:5
|
|
|
|
|
30 | 3 & 5 - 2;
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 & (5 - 2)`
|
|
|
|
error: unary minus has lower precedence than method call
|
|
--> $DIR/precedence.rs:31:5
|
|
|
|
|
31 | -1i32.abs();
|
|
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1i32.abs())`
|
|
|
|
error: unary minus has lower precedence than method call
|
|
--> $DIR/precedence.rs:32:5
|
|
|
|
|
32 | -1f32.abs();
|
|
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1f32.abs())`
|
|
|
|
error: aborting due to 9 previous errors
|
|
|