Skip to content

Commit cbf6b7e

Browse files
committed
Allow collection_is_never_read in tests of unrelated lints
1 parent 783b6d7 commit cbf6b7e

File tree

95 files changed

+603
-516
lines changed

Some content is hidden

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

95 files changed

+603
-516
lines changed

tests/ui-toml/too_large_for_stack/useless_vec.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::useless_vec)]
2+
#![allow(clippy::collection_is_never_read)]
23

34
fn main() {
45
let x = [0u8; 500];

tests/ui-toml/too_large_for_stack/useless_vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![warn(clippy::useless_vec)]
2+
#![allow(clippy::collection_is_never_read)]
23

34
fn main() {
45
let x = vec![0u8; 500];

tests/ui-toml/too_large_for_stack/useless_vec.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: useless use of `vec!`
2-
--> $DIR/useless_vec.rs:4:13
2+
--> $DIR/useless_vec.rs:5:13
33
|
44
LL | let x = vec![0u8; 500];
55
| ^^^^^^^^^^^^^^ help: you can use an array directly: `[0u8; 500]`

tests/ui/boxed_local.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
clippy::needless_pass_by_value,
55
clippy::unused_unit,
66
clippy::redundant_clone,
7-
clippy::match_single_binding
7+
clippy::match_single_binding,
8+
clippy::collection_is_never_read
89
)]
910
#![warn(clippy::boxed_local)]
1011

tests/ui/boxed_local.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: local variable doesn't need to be boxed here
2-
--> $DIR/boxed_local.rs:40:13
2+
--> $DIR/boxed_local.rs:41:13
33
|
44
LL | fn warn_arg(x: Box<A>) {
55
| ^
@@ -8,19 +8,19 @@ LL | fn warn_arg(x: Box<A>) {
88
= help: to override `-D warnings` add `#[allow(clippy::boxed_local)]`
99

1010
error: local variable doesn't need to be boxed here
11-
--> $DIR/boxed_local.rs:123:12
11+
--> $DIR/boxed_local.rs:124:12
1212
|
1313
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
1414
| ^^^^^^^^^^^
1515

1616
error: local variable doesn't need to be boxed here
17-
--> $DIR/boxed_local.rs:188:44
17+
--> $DIR/boxed_local.rs:189:44
1818
|
1919
LL | fn default_impl_x(self: Box<Self>, x: Box<u32>) -> u32 {
2020
| ^
2121

2222
error: local variable doesn't need to be boxed here
23-
--> $DIR/boxed_local.rs:196:16
23+
--> $DIR/boxed_local.rs:197:16
2424
|
2525
LL | fn foo(x: Box<u32>) {}
2626
| ^

tests/ui/branches_sharing_code/shared_at_top.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
22
#![allow(dead_code)]
3-
#![allow(clippy::mixed_read_write_in_expression, clippy::uninlined_format_args)]
3+
#![allow(
4+
clippy::mixed_read_write_in_expression,
5+
clippy::uninlined_format_args,
6+
clippy::collection_is_never_read
7+
)]
48
//@no-rustfix
59
// This tests the branches_sharing_code lint at the start of blocks
610

tests/ui/branches_sharing_code/shared_at_top.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: all if blocks contain the same code at the start
2-
--> $DIR/shared_at_top.rs:11:5
2+
--> $DIR/shared_at_top.rs:15:5
33
|
44
LL | / if true {
55
LL | |
@@ -18,7 +18,7 @@ LL + if true {
1818
|
1919

2020
error: all if blocks contain the same code at the start
21-
--> $DIR/shared_at_top.rs:21:5
21+
--> $DIR/shared_at_top.rs:25:5
2222
|
2323
LL | / if x == 0 {
2424
LL | |
@@ -37,7 +37,7 @@ LL + if x == 0 {
3737
|
3838

3939
error: all if blocks contain the same code at the start
40-
--> $DIR/shared_at_top.rs:43:5
40+
--> $DIR/shared_at_top.rs:47:5
4141
|
4242
LL | / let _ = if x == 7 {
4343
LL | |
@@ -51,7 +51,7 @@ LL + let _ = if x == 7 {
5151
|
5252

5353
error: all if blocks contain the same code at the start
54-
--> $DIR/shared_at_top.rs:62:5
54+
--> $DIR/shared_at_top.rs:66:5
5555
|
5656
LL | / if x == 10 {
5757
LL | |
@@ -68,7 +68,7 @@ LL + if x == 10 {
6868
|
6969

7070
error: all if blocks contain the same code at the start
71-
--> $DIR/shared_at_top.rs:77:5
71+
--> $DIR/shared_at_top.rs:81:5
7272
|
7373
LL | / if x == 11 {
7474
LL | |
@@ -85,7 +85,7 @@ LL + if x == 11 {
8585
|
8686

8787
error: all if blocks contain the same code at the start
88-
--> $DIR/shared_at_top.rs:94:5
88+
--> $DIR/shared_at_top.rs:98:5
8989
|
9090
LL | / if x == 2020 {
9191
LL | |
@@ -101,7 +101,7 @@ LL + if x == 2020 {
101101
|
102102

103103
error: this `if` has identical blocks
104-
--> $DIR/shared_at_top.rs:103:18
104+
--> $DIR/shared_at_top.rs:107:18
105105
|
106106
LL | if x == 2019 {
107107
| __________________^
@@ -111,7 +111,7 @@ LL | | } else {
111111
| |_____^
112112
|
113113
note: same as this
114-
--> $DIR/shared_at_top.rs:106:12
114+
--> $DIR/shared_at_top.rs:110:12
115115
|
116116
LL | } else {
117117
| ____________^

tests/ui/clear_with_drain.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, clippy::collection_is_never_read)]
22
#![warn(clippy::clear_with_drain)]
33

44
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};

tests/ui/clear_with_drain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, clippy::collection_is_never_read)]
22
#![warn(clippy::clear_with_drain)]
33

44
use std::collections::{BinaryHeap, HashMap, HashSet, VecDeque};

tests/ui/clone_on_copy.fixed

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
clippy::unnecessary_operation,
77
clippy::vec_init_then_push,
88
clippy::toplevel_ref_arg,
9-
clippy::needless_borrow
9+
clippy::needless_borrow,
10+
clippy::collection_is_never_read
1011
)]
1112

1213
use std::cell::RefCell;

0 commit comments

Comments
 (0)