Skip to content

Commit 13cc452

Browse files
committed
Add allow unused
1 parent dce3151 commit 13cc452

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tests/ui/neg_multiply.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22
#![warn(clippy::neg_multiply)]
33
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
4+
#![allow(unused)]
45

56
use std::ops::Mul;
67

tests/ui/neg_multiply.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-rustfix
22
#![warn(clippy::neg_multiply)]
33
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::precedence)]
4+
#![allow(unused)]
45

56
use std::ops::Mul;
67

tests/ui/neg_multiply.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error: this multiplication by -1 can be written more succinctly
2-
--> $DIR/neg_multiply.rs:28:5
2+
--> $DIR/neg_multiply.rs:29:5
33
|
44
LL | x * -1;
55
| ^^^^^^ help: consider using: `-x`
66
|
77
= note: `-D clippy::neg-multiply` implied by `-D warnings`
88

99
error: this multiplication by -1 can be written more succinctly
10-
--> $DIR/neg_multiply.rs:30:5
10+
--> $DIR/neg_multiply.rs:31:5
1111
|
1212
LL | -1 * x;
1313
| ^^^^^^ help: consider using: `-x`
1414

1515
error: this multiplication by -1 can be written more succinctly
16-
--> $DIR/neg_multiply.rs:32:11
16+
--> $DIR/neg_multiply.rs:33:11
1717
|
1818
LL | 100 + x * -1;
1919
| ^^^^^^ help: consider using: `-x`
2020

2121
error: this multiplication by -1 can be written more succinctly
22-
--> $DIR/neg_multiply.rs:34:5
22+
--> $DIR/neg_multiply.rs:35:5
2323
|
2424
LL | (100 + x) * -1;
2525
| ^^^^^^^^^^^^^^ help: consider using: `-(100 + x)`
2626

2727
error: this multiplication by -1 can be written more succinctly
28-
--> $DIR/neg_multiply.rs:36:5
28+
--> $DIR/neg_multiply.rs:37:5
2929
|
3030
LL | -1 * 17;
3131
| ^^^^^^^ help: consider using: `-17`
3232

3333
error: this multiplication by -1 can be written more succinctly
34-
--> $DIR/neg_multiply.rs:38:14
34+
--> $DIR/neg_multiply.rs:39:14
3535
|
3636
LL | 0xcafe | 0xff00 * -1;
3737
| ^^^^^^^^^^^ help: consider using: `-0xff00`

0 commit comments

Comments
 (0)