2017-02-07 20:05:30 +00:00
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:8:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
8 | 1 << 2 + 3;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-17 12:19:44 +00:00
|
|
|
= note: `-D precedence` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:9:5
|
2017-05-11 14:32:42 +00:00
|
|
|
|
|
|
|
|
9 | 1 + 2 << 3;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:10:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
10 | 4 >> 1 + 1;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `4 >> (1 + 1)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:11:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
11 | 1 + 3 >> 2;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 3) >> 2`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:12:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
12 | 1 ^ 1 - 1;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `1 ^ (1 - 1)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:13:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
13 | 3 | 2 - 1;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 | (2 - 1)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: operator precedence can trip the unwary
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:14:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
14 | 3 & 5 - 2;
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^ help: consider parenthesizing your expression: `3 & (5 - 2)`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: unary minus has lower precedence than method call
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:15:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
15 | -1i32.abs();
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1i32.abs())`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: unary minus has lower precedence than method call
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/precedence.rs:16:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2017-05-11 14:32:42 +00:00
|
|
|
16 | -1f32.abs();
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1f32.abs())`
|
2017-02-07 20:05:30 +00:00
|
|
|
|