mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 14:38:46 +00:00
Add allow precedence lint to prevent rustfix from failing
This commit is contained in:
parent
88e40bc73d
commit
dce3151872
3 changed files with 3 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![warn(clippy::neg_multiply)]
|
||||
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
|
||||
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
|
||||
|
||||
use std::ops::Mul;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![warn(clippy::neg_multiply)]
|
||||
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
|
||||
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
|
||||
|
||||
use std::ops::Mul;
|
||||
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
error: operator precedence can trip the unwary
|
||||
--> $DIR/neg_multiply.rs:38:5
|
||||
|
|
||||
LL | 0xcafe | 0xff00 * -1;
|
||||
| ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `0xcafe | (0xff00 * -1)`
|
||||
|
|
||||
= note: `-D clippy::precedence` implied by `-D warnings`
|
||||
|
||||
error: this multiplication by -1 can be written more succinctly
|
||||
--> $DIR/neg_multiply.rs:28:5
|
||||
|
|
||||
|
@ -44,5 +36,5 @@ error: this multiplication by -1 can be written more succinctly
|
|||
LL | 0xcafe | 0xff00 * -1;
|
||||
| ^^^^^^^^^^^ help: consider using: `-0xff00`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue