]> git.lizzy.rs Git - rust.git/blob - tests/ui/neg_multiply.stderr
Add support for suggestion when using an expression
[rust.git] / tests / ui / neg_multiply.stderr
1 error: operator precedence can trip the unwary
2   --> $DIR/neg_multiply.rs:38:5
3    |
4 LL |     0xcafe | 0xff00 * -1;
5    |     ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `0xcafe | (0xff00 * -1)`
6    |
7    = note: `-D clippy::precedence` implied by `-D warnings`
8
9 error: this multiplication by -1 can be written more succinctly
10   --> $DIR/neg_multiply.rs:28:5
11    |
12 LL |     x * -1;
13    |     ^^^^^^ help: consider using: `-x`
14    |
15    = note: `-D clippy::neg-multiply` implied by `-D warnings`
16
17 error: this multiplication by -1 can be written more succinctly
18   --> $DIR/neg_multiply.rs:30:5
19    |
20 LL |     -1 * x;
21    |     ^^^^^^ help: consider using: `-x`
22
23 error: this multiplication by -1 can be written more succinctly
24   --> $DIR/neg_multiply.rs:32:11
25    |
26 LL |     100 + x * -1;
27    |           ^^^^^^ help: consider using: `-x`
28
29 error: this multiplication by -1 can be written more succinctly
30   --> $DIR/neg_multiply.rs:34:5
31    |
32 LL |     (100 + x) * -1;
33    |     ^^^^^^^^^^^^^^ help: consider using: `-(100 + x)`
34
35 error: this multiplication by -1 can be written more succinctly
36   --> $DIR/neg_multiply.rs:36:5
37    |
38 LL |     -1 * 17;
39    |     ^^^^^^^ help: consider using: `-17`
40
41 error: this multiplication by -1 can be written more succinctly
42   --> $DIR/neg_multiply.rs:38:14
43    |
44 LL |     0xcafe | 0xff00 * -1;
45    |              ^^^^^^^^^^^ help: consider using: `-0xff00`
46
47 error: aborting due to 7 previous errors
48