rust-clippy/tests/ui/precedence.stderr

59 lines
1.8 KiB
Text
Raw Normal View History

error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:18:5
|
18 | 1 << 2 + 3;
| ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
|
= note: `-D precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:19:5
|
19 | 1 + 2 << 3;
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:20:5
|
2018-01-16 14:52:16 +00:00
20 | 4 >> 1 + 1;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: consider parenthesizing your expression: `4 >> (1 + 1)`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:21:5
|
2018-01-16 14:52:16 +00:00
21 | 1 + 3 >> 2;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 3) >> 2`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:22:5
|
2018-01-16 14:52:16 +00:00
22 | 1 ^ 1 - 1;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: consider parenthesizing your expression: `1 ^ (1 - 1)`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:23:5
|
2018-01-16 14:52:16 +00:00
23 | 3 | 2 - 1;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 | (2 - 1)`
error: operator precedence can trip the unwary
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:24:5
|
2018-01-16 14:52:16 +00:00
24 | 3 & 5 - 2;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 & (5 - 2)`
error: unary minus has lower precedence than method call
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:25:5
|
2018-01-16 14:52:16 +00:00
25 | -1i32.abs();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1i32.abs())`
error: unary minus has lower precedence than method call
2018-01-16 14:52:16 +00:00
--> $DIR/precedence.rs:26:5
|
2018-01-16 14:52:16 +00:00
26 | -1f32.abs();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1f32.abs())`
2018-01-16 16:06:27 +00:00
error: aborting due to 9 previous errors