Skip to content

Commit dce3151

Browse files
committed
Add allow precedence lint to prevent rustfix from failing
1 parent 88e40bc commit dce3151

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

tests/ui/neg_multiply.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::neg_multiply)]
3-
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
3+
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
44

55
use std::ops::Mul;
66

tests/ui/neg_multiply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::neg_multiply)]
3-
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
3+
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
44

55
use std::ops::Mul;
66

tests/ui/neg_multiply.stderr

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
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-
91
error: this multiplication by -1 can be written more succinctly
102
--> $DIR/neg_multiply.rs:28:5
113
|
@@ -44,5 +36,5 @@ error: this multiplication by -1 can be written more succinctly
4436
LL | 0xcafe | 0xff00 * -1;
4537
| ^^^^^^^^^^^ help: consider using: `-0xff00`
4638

47-
error: aborting due to 7 previous errors
39+
error: aborting due to 6 previous errors
4840

0 commit comments

Comments
 (0)