Skip to content

Commit 122c4a6

Browse files
committed
Allow this lint on lint tests
1 parent 83c51bb commit 122c4a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+237
-213
lines changed

tests/ui/derive_ord_xor_partial_ord.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::derive_ord_xor_partial_ord)]
2+
#![allow(clippy::unnecessary_wrap)]
23

34
use std::cmp::Ordering;
45

tests/ui/derive_ord_xor_partial_ord.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
2-
--> $DIR/derive_ord_xor_partial_ord.rs:20:10
2+
--> $DIR/derive_ord_xor_partial_ord.rs:21:10
33
|
44
LL | #[derive(Ord, PartialEq, Eq)]
55
| ^^^
66
|
77
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
88
note: `PartialOrd` implemented here
9-
--> $DIR/derive_ord_xor_partial_ord.rs:23:1
9+
--> $DIR/derive_ord_xor_partial_ord.rs:24:1
1010
|
1111
LL | / impl PartialOrd for DeriveOrd {
1212
LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
@@ -17,13 +17,13 @@ LL | | }
1717
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
1818

1919
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
20-
--> $DIR/derive_ord_xor_partial_ord.rs:29:10
20+
--> $DIR/derive_ord_xor_partial_ord.rs:30:10
2121
|
2222
LL | #[derive(Ord, PartialEq, Eq)]
2323
| ^^^
2424
|
2525
note: `PartialOrd` implemented here
26-
--> $DIR/derive_ord_xor_partial_ord.rs:32:1
26+
--> $DIR/derive_ord_xor_partial_ord.rs:33:1
2727
|
2828
LL | / impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
2929
LL | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
@@ -34,7 +34,7 @@ LL | | }
3434
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
3535

3636
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
37-
--> $DIR/derive_ord_xor_partial_ord.rs:41:1
37+
--> $DIR/derive_ord_xor_partial_ord.rs:42:1
3838
|
3939
LL | / impl std::cmp::Ord for DerivePartialOrd {
4040
LL | | fn cmp(&self, other: &Self) -> Ordering {
@@ -44,14 +44,14 @@ LL | | }
4444
| |_^
4545
|
4646
note: `PartialOrd` implemented here
47-
--> $DIR/derive_ord_xor_partial_ord.rs:38:10
47+
--> $DIR/derive_ord_xor_partial_ord.rs:39:10
4848
|
4949
LL | #[derive(PartialOrd, PartialEq, Eq)]
5050
| ^^^^^^^^^^
5151
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
5252

5353
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
54-
--> $DIR/derive_ord_xor_partial_ord.rs:61:5
54+
--> $DIR/derive_ord_xor_partial_ord.rs:62:5
5555
|
5656
LL | / impl Ord for DerivePartialOrdInUseOrd {
5757
LL | | fn cmp(&self, other: &Self) -> Ordering {
@@ -61,7 +61,7 @@ LL | | }
6161
| |_____^
6262
|
6363
note: `PartialOrd` implemented here
64-
--> $DIR/derive_ord_xor_partial_ord.rs:58:14
64+
--> $DIR/derive_ord_xor_partial_ord.rs:59:14
6565
|
6666
LL | #[derive(PartialOrd, PartialEq, Eq)]
6767
| ^^^^^^^^^^

tests/ui/doc_errors.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// edition:2018
22
#![warn(clippy::missing_errors_doc)]
3+
#![allow(clippy::unnecessary_wrap)]
34

45
use std::io;
56

tests/ui/doc_errors.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: docs for function returning `Result` missing `# Errors` section
2-
--> $DIR/doc_errors.rs:6:1
2+
--> $DIR/doc_errors.rs:7:1
33
|
44
LL | / pub fn pub_fn_missing_errors_header() -> Result<(), ()> {
55
LL | | unimplemented!();
@@ -9,47 +9,47 @@ LL | | }
99
= note: `-D clippy::missing-errors-doc` implied by `-D warnings`
1010

1111
error: docs for function returning `Result` missing `# Errors` section
12-
--> $DIR/doc_errors.rs:10:1
12+
--> $DIR/doc_errors.rs:11:1
1313
|
1414
LL | / pub async fn async_pub_fn_missing_errors_header() -> Result<(), ()> {
1515
LL | | unimplemented!();
1616
LL | | }
1717
| |_^
1818

1919
error: docs for function returning `Result` missing `# Errors` section
20-
--> $DIR/doc_errors.rs:15:1
20+
--> $DIR/doc_errors.rs:16:1
2121
|
2222
LL | / pub fn pub_fn_returning_io_result() -> io::Result<()> {
2323
LL | | unimplemented!();
2424
LL | | }
2525
| |_^
2626

2727
error: docs for function returning `Result` missing `# Errors` section
28-
--> $DIR/doc_errors.rs:20:1
28+
--> $DIR/doc_errors.rs:21:1
2929
|
3030
LL | / pub async fn async_pub_fn_returning_io_result() -> io::Result<()> {
3131
LL | | unimplemented!();
3232
LL | | }
3333
| |_^
3434

3535
error: docs for function returning `Result` missing `# Errors` section
36-
--> $DIR/doc_errors.rs:50:5
36+
--> $DIR/doc_errors.rs:51:5
3737
|
3838
LL | / pub fn pub_method_missing_errors_header() -> Result<(), ()> {
3939
LL | | unimplemented!();
4040
LL | | }
4141
| |_____^
4242

4343
error: docs for function returning `Result` missing `# Errors` section
44-
--> $DIR/doc_errors.rs:55:5
44+
--> $DIR/doc_errors.rs:56:5
4545
|
4646
LL | / pub async fn async_pub_method_missing_errors_header() -> Result<(), ()> {
4747
LL | | unimplemented!();
4848
LL | | }
4949
| |_____^
5050

5151
error: docs for function returning `Result` missing `# Errors` section
52-
--> $DIR/doc_errors.rs:84:5
52+
--> $DIR/doc_errors.rs:85:5
5353
|
5454
LL | fn trait_method_missing_errors_header() -> Result<(), ()>;
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/drop_ref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![warn(clippy::drop_ref)]
22
#![allow(clippy::toplevel_ref_arg)]
3+
#![allow(clippy::unnecessary_wrap)]
34

45
use std::mem::drop;
56

tests/ui/drop_ref.stderr

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
11
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
2-
--> $DIR/drop_ref.rs:9:5
2+
--> $DIR/drop_ref.rs:10:5
33
|
44
LL | drop(&SomeStruct);
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::drop-ref` implied by `-D warnings`
88
note: argument has type `&SomeStruct`
9-
--> $DIR/drop_ref.rs:9:10
9+
--> $DIR/drop_ref.rs:10:10
1010
|
1111
LL | drop(&SomeStruct);
1212
| ^^^^^^^^^^^
1313

1414
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
15-
--> $DIR/drop_ref.rs:12:5
15+
--> $DIR/drop_ref.rs:13:5
1616
|
1717
LL | drop(&owned1);
1818
| ^^^^^^^^^^^^^
1919
|
2020
note: argument has type `&SomeStruct`
21-
--> $DIR/drop_ref.rs:12:10
21+
--> $DIR/drop_ref.rs:13:10
2222
|
2323
LL | drop(&owned1);
2424
| ^^^^^^^
2525

2626
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
27-
--> $DIR/drop_ref.rs:13:5
27+
--> $DIR/drop_ref.rs:14:5
2828
|
2929
LL | drop(&&owned1);
3030
| ^^^^^^^^^^^^^^
3131
|
3232
note: argument has type `&&SomeStruct`
33-
--> $DIR/drop_ref.rs:13:10
33+
--> $DIR/drop_ref.rs:14:10
3434
|
3535
LL | drop(&&owned1);
3636
| ^^^^^^^^
3737

3838
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
39-
--> $DIR/drop_ref.rs:14:5
39+
--> $DIR/drop_ref.rs:15:5
4040
|
4141
LL | drop(&mut owned1);
4242
| ^^^^^^^^^^^^^^^^^
4343
|
4444
note: argument has type `&mut SomeStruct`
45-
--> $DIR/drop_ref.rs:14:10
45+
--> $DIR/drop_ref.rs:15:10
4646
|
4747
LL | drop(&mut owned1);
4848
| ^^^^^^^^^^^
4949

5050
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
51-
--> $DIR/drop_ref.rs:18:5
51+
--> $DIR/drop_ref.rs:19:5
5252
|
5353
LL | drop(reference1);
5454
| ^^^^^^^^^^^^^^^^
5555
|
5656
note: argument has type `&SomeStruct`
57-
--> $DIR/drop_ref.rs:18:10
57+
--> $DIR/drop_ref.rs:19:10
5858
|
5959
LL | drop(reference1);
6060
| ^^^^^^^^^^
6161

6262
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
63-
--> $DIR/drop_ref.rs:21:5
63+
--> $DIR/drop_ref.rs:22:5
6464
|
6565
LL | drop(reference2);
6666
| ^^^^^^^^^^^^^^^^
6767
|
6868
note: argument has type `&mut SomeStruct`
69-
--> $DIR/drop_ref.rs:21:10
69+
--> $DIR/drop_ref.rs:22:10
7070
|
7171
LL | drop(reference2);
7272
| ^^^^^^^^^^
7373

7474
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
75-
--> $DIR/drop_ref.rs:24:5
75+
--> $DIR/drop_ref.rs:25:5
7676
|
7777
LL | drop(reference3);
7878
| ^^^^^^^^^^^^^^^^
7979
|
8080
note: argument has type `&SomeStruct`
81-
--> $DIR/drop_ref.rs:24:10
81+
--> $DIR/drop_ref.rs:25:10
8282
|
8383
LL | drop(reference3);
8484
| ^^^^^^^^^^
8585

8686
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
87-
--> $DIR/drop_ref.rs:29:5
87+
--> $DIR/drop_ref.rs:30:5
8888
|
8989
LL | drop(&val);
9090
| ^^^^^^^^^^
9191
|
9292
note: argument has type `&T`
93-
--> $DIR/drop_ref.rs:29:10
93+
--> $DIR/drop_ref.rs:30:10
9494
|
9595
LL | drop(&val);
9696
| ^^^^
9797

9898
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
99-
--> $DIR/drop_ref.rs:37:5
99+
--> $DIR/drop_ref.rs:38:5
100100
|
101101
LL | std::mem::drop(&SomeStruct);
102102
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
103103
|
104104
note: argument has type `&SomeStruct`
105-
--> $DIR/drop_ref.rs:37:20
105+
--> $DIR/drop_ref.rs:38:20
106106
|
107107
LL | std::mem::drop(&SomeStruct);
108108
| ^^^^^^^^^^^

tests/ui/forget_ref.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![warn(clippy::forget_ref)]
22
#![allow(clippy::toplevel_ref_arg)]
3+
#![allow(clippy::unnecessary_wrap)]
34

45
use std::mem::forget;
56

0 commit comments

Comments
 (0)