rust/tests/ui/precedence.stderr

77 lines
2.5 KiB
Plaintext
Raw Normal View History

error: operator precedence can trip the unwary
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:17:5
2018-01-16 14:52:16 +00:00
|
2018-12-27 15:57:55 +00:00
LL | 1 << 2 + 3;
2018-01-16 14:52:16 +00:00
| ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
|
= note: `-D clippy::precedence` implied by `-D warnings`
error: operator precedence can trip the unwary
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:18:5
2018-01-16 14:52:16 +00:00
|
2018-12-27 15:57:55 +00:00
LL | 1 + 2 << 3;
2018-01-16 14:52:16 +00:00
| ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
error: operator precedence can trip the unwary
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:19:5
|
2018-12-27 15:57:55 +00:00
LL | 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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:20:5
|
2018-12-27 15:57:55 +00:00
LL | 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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:21:5
|
2018-12-27 15:57:55 +00:00
LL | 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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:22:5
|
2018-12-27 15:57:55 +00:00
LL | 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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:23:5
|
2018-12-27 15:57:55 +00:00
LL | 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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:24:5
|
2018-12-27 15:57:55 +00:00
LL | -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
2019-01-13 13:24:21 +00:00
--> $DIR/precedence.rs:25:5
|
2018-12-27 15:57:55 +00:00
LL | -1f32.abs();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1f32.abs())`
error: unary minus has lower precedence than method call
--> $DIR/precedence.rs:52:13
|
LL | let _ = -1.0_f64.cos().cos();
| ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.cos().cos())`
error: unary minus has lower precedence than method call
--> $DIR/precedence.rs:53:13
|
LL | let _ = -1.0_f64.cos().sin();
| ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.cos().sin())`
error: unary minus has lower precedence than method call
--> $DIR/precedence.rs:54:13
|
LL | let _ = -1.0_f64.sin().cos();
| ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.sin().cos())`
error: aborting due to 12 previous errors
2018-01-16 16:06:27 +00:00