]> git.lizzy.rs Git - rust.git/blob - tests/ui/precedence.stderr
rustup and compile-fail -> ui test move
[rust.git] / tests / ui / precedence.stderr
1 error: operator precedence can trip the unwary
2  --> $DIR/precedence.rs:8:5
3   |
4 8 |     1 << 2 + 3;
5   |     ^^^^^^^^^^
6   |
7 note: lint level defined here
8  --> $DIR/precedence.rs:4:8
9   |
10 4 | #[deny(precedence)]
11   |        ^^^^^^^^^^
12 help: consider parenthesizing your expression
13   |     1 << (2 + 3);
14
15 error: operator precedence can trip the unwary
16   --> $DIR/precedence.rs:11:5
17    |
18 11 |     1 + 2 << 3;
19    |     ^^^^^^^^^^
20    |
21 help: consider parenthesizing your expression
22    |     (1 + 2) << 3;
23
24 error: operator precedence can trip the unwary
25   --> $DIR/precedence.rs:14:5
26    |
27 14 |     4 >> 1 + 1;
28    |     ^^^^^^^^^^
29    |
30 help: consider parenthesizing your expression
31    |     4 >> (1 + 1);
32
33 error: operator precedence can trip the unwary
34   --> $DIR/precedence.rs:17:5
35    |
36 17 |     1 + 3 >> 2;
37    |     ^^^^^^^^^^
38    |
39 help: consider parenthesizing your expression
40    |     (1 + 3) >> 2;
41
42 error: operator precedence can trip the unwary
43   --> $DIR/precedence.rs:20:5
44    |
45 20 |     1 ^ 1 - 1;
46    |     ^^^^^^^^^
47    |
48 help: consider parenthesizing your expression
49    |     1 ^ (1 - 1);
50
51 error: operator precedence can trip the unwary
52   --> $DIR/precedence.rs:23:5
53    |
54 23 |     3 | 2 - 1;
55    |     ^^^^^^^^^
56    |
57 help: consider parenthesizing your expression
58    |     3 | (2 - 1);
59
60 error: operator precedence can trip the unwary
61   --> $DIR/precedence.rs:26:5
62    |
63 26 |     3 & 5 - 2;
64    |     ^^^^^^^^^
65    |
66 help: consider parenthesizing your expression
67    |     3 & (5 - 2);
68
69 error: unary minus has lower precedence than method call
70   --> $DIR/precedence.rs:30:5
71    |
72 30 |     -1i32.abs();
73    |     ^^^^^^^^^^^
74    |
75 help: consider adding parentheses to clarify your intent
76    |     -(1i32.abs());
77
78 error: unary minus has lower precedence than method call
79   --> $DIR/precedence.rs:33:5
80    |
81 33 |     -1f32.abs();
82    |     ^^^^^^^^^^^
83    |
84 help: consider adding parentheses to clarify your intent
85    |     -(1f32.abs());
86
87 error: aborting due to 9 previous errors
88