Skip to content

Commit 06e81bb

Browse files
committed
Update references
1 parent 40d7af5 commit 06e81bb

28 files changed

+43
-506
lines changed

tests/ui/borrow_box.stderr

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
2222
LL | fn test4(a: &Box<bool>);
2323
| ^^^^^^^^^^ help: try: `&bool`
2424

25-
error: non-binding let on a type that implements `Drop`
26-
--> $DIR/borrow_box.rs:63:5
27-
|
28-
LL | let _ = foo;
29-
| ^^^^^^^^^^^^
30-
|
31-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
32-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
33-
3425
error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
3526
--> $DIR/borrow_box.rs:95:25
3627
|
@@ -73,5 +64,5 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
7364
LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {}
7465
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`
7566

76-
error: aborting due to 11 previous errors
67+
error: aborting due to 10 previous errors
7768

tests/ui/borrow_interior_mutable_const/others.stderr

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
4747
|
4848
= help: assign this const to a local or static variable, and use the variable here
4949

50-
error: non-binding let on a type that implements `Drop`
51-
--> $DIR/others.rs:72:5
52-
|
53-
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
54-
| ^^^^^^^^^^^^^^^^^^^^^^
55-
|
56-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
57-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
58-
5950
error: a `const` item with interior mutability should not be borrowed
6051
--> $DIR/others.rs:72:14
6152
|
@@ -104,22 +95,6 @@ LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
10495
|
10596
= help: assign this const to a local or static variable, and use the variable here
10697

107-
error: non-binding let on a type that implements `Drop`
108-
--> $DIR/others.rs:83:5
109-
|
110-
LL | let _ = ATOMIC_TUPLE.1.into_iter();
111-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112-
|
113-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
114-
115-
error: non-binding let on a type that implements `Drop`
116-
--> $DIR/others.rs:85:5
117-
|
118-
LL | let _ = &{ ATOMIC_TUPLE };
119-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
120-
|
121-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
122-
12398
error: a `const` item with interior mutability should not be borrowed
12499
--> $DIR/others.rs:87:5
125100
|
@@ -136,5 +111,5 @@ LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
136111
|
137112
= help: assign this const to a local or static variable, and use the variable here
138113

139-
error: aborting due to 17 previous errors
114+
error: aborting due to 14 previous errors
140115

tests/ui/box_vec.stderr

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
error: non-binding let on a type that implements `Drop`
2-
--> $DIR/box_vec.rs:7:9
3-
|
4-
LL | let _: Box<$x> = Box::new($init);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
...
7-
LL | boxit!(Vec::new(), Vec<u8>);
8-
| ---------------------------- in this macro invocation
9-
|
10-
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
11-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
12-
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
13-
141
error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
152
--> $DIR/box_vec.rs:14:18
163
|
@@ -20,5 +7,5 @@ LL | pub fn test(foo: Box<Vec<bool>>) {
207
= note: `-D clippy::box-vec` implied by `-D warnings`
218
= help: `Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.
229

23-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
2411

tests/ui/crashes/ice-4968.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/crashes/ice-5223.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/escape_analysis.stderr

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,5 @@ error: local variable doesn't need to be boxed here
1212
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
1313
| ^^^^^^^^^^^
1414

15-
error: non-binding let on a type that implements `Drop`
16-
--> $DIR/escape_analysis.rs:166:9
17-
|
18-
LL | / let _ = move || {
19-
LL | | consume(x);
20-
LL | | };
21-
| |__________^
22-
|
23-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
24-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
25-
26-
error: non-binding let on a type that implements `Drop`
27-
--> $DIR/escape_analysis.rs:172:9
28-
|
29-
LL | / let _ = || {
30-
LL | | borrow(&x);
31-
LL | | };
32-
| |__________^
33-
|
34-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
35-
36-
error: aborting due to 4 previous errors
15+
error: aborting due to 2 previous errors
3716

tests/ui/eta.stderr

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ error: redundant closure found
6464
LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
6565
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase`
6666

67-
error: non-binding let on a type that implements `Drop`
68-
--> $DIR/eta.rs:107:5
69-
|
70-
LL | let _: Vec<_> = arr.iter().map(|x| x.map_err(|e| some.take().unwrap()(e))).collect();
71-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72-
|
73-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
74-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
75-
7667
error: redundant closure found
7768
--> $DIR/eta.rs:172:27
7869
|
@@ -85,13 +76,5 @@ error: redundant closure found
8576
LL | let a = Some(1u8).map(|a| closure(a));
8677
| ^^^^^^^^^^^^^^ help: remove closure as shown: `closure`
8778

88-
error: non-binding let on a type that implements `Drop`
89-
--> $DIR/eta.rs:203:5
90-
|
91-
LL | let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();
92-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93-
|
94-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
95-
96-
error: aborting due to 14 previous errors
79+
error: aborting due to 12 previous errors
9780

tests/ui/filter_methods.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: non-binding let on a type that implements `Drop`
1+
error: non-binding `let` on a type that implements `Drop`
22
--> $DIR/filter_methods.rs:5:5
33
|
44
LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
@@ -16,7 +16,7 @@ LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x *
1616
= note: `-D clippy::filter-map` implied by `-D warnings`
1717
= help: this is more succinctly expressed by calling `.filter_map(..)` instead
1818

19-
error: non-binding let on a type that implements `Drop`
19+
error: non-binding `let` on a type that implements `Drop`
2020
--> $DIR/filter_methods.rs:7:5
2121
|
2222
LL | / let _: Vec<_> = vec![5_i8; 6]
@@ -40,7 +40,7 @@ LL | | .flat_map(|x| x.checked_mul(2))
4040
|
4141
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
4242

43-
error: non-binding let on a type that implements `Drop`
43+
error: non-binding `let` on a type that implements `Drop`
4444
--> $DIR/filter_methods.rs:13:5
4545
|
4646
LL | / let _: Vec<_> = vec![5_i8; 6]
@@ -64,7 +64,7 @@ LL | | .flat_map(|x| x.checked_mul(2))
6464
|
6565
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
6666

67-
error: non-binding let on a type that implements `Drop`
67+
error: non-binding `let` on a type that implements `Drop`
6868
--> $DIR/filter_methods.rs:19:5
6969
|
7070
LL | / let _: Vec<_> = vec![5_i8; 6]

tests/ui/get_unwrap.stderr

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,34 +70,17 @@ error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and
7070
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`
7272

73-
error: non-binding let on a type that implements `Drop`
74-
--> $DIR/get_unwrap.rs:59:9
75-
|
76-
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
77-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78-
|
79-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
80-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
81-
8273
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
8374
--> $DIR/get_unwrap.rs:59:17
8475
|
8576
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
8677
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
8778

88-
error: non-binding let on a type that implements `Drop`
89-
--> $DIR/get_unwrap.rs:60:9
90-
|
91-
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
92-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93-
|
94-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
95-
9679
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
9780
--> $DIR/get_unwrap.rs:60:17
9881
|
9982
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
10083
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`
10184

102-
error: aborting due to 15 previous errors
85+
error: aborting due to 13 previous errors
10386

tests/ui/into_iter_on_ref.stderr

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
error: non-binding let on a type that implements `Drop`
2-
--> $DIR/into_iter_on_ref.rs:13:5
3-
|
4-
LL | let _ = vec![1, 2, 3].into_iter();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
8-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
9-
101
error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
112
--> $DIR/into_iter_on_ref.rs:14:30
123
|
@@ -171,5 +162,5 @@ error: this `.into_iter()` call is equivalent to `.iter()` and will not consume
171162
LL | let _ = (&[1, 2, 3]).into_iter().next(); //~ WARN equivalent to .iter()
172163
| ^^^^^^^^^ help: call directly: `iter`
173164

174-
error: aborting due to 28 previous errors
165+
error: aborting due to 27 previous errors
175166

tests/ui/iter_cloned_collect.stderr

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,12 @@ LL | let v2: Vec<isize> = v.iter().cloned().collect();
66
|
77
= note: `-D clippy::iter-cloned-collect` implied by `-D warnings`
88

9-
error: non-binding let on a type that implements `Drop`
10-
--> $DIR/iter_cloned_collect.rs:15:5
11-
|
12-
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14-
|
15-
= note: `#[deny(clippy::let_underscore_drop)]` on by default
16-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
17-
189
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
1910
--> $DIR/iter_cloned_collect.rs:15:38
2011
|
2112
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
2213
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`
2314

24-
error: non-binding let on a type that implements `Drop`
25-
--> $DIR/iter_cloned_collect.rs:19:9
26-
|
27-
LL | / let _: Vec<u8> = std::ffi::CStr::from_ptr(std::ptr::null())
28-
LL | | .to_bytes()
29-
LL | | .iter()
30-
LL | | .cloned()
31-
LL | | .collect();
32-
| |_______________________^
33-
|
34-
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
35-
3615
error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
3716
--> $DIR/iter_cloned_collect.rs:20:24
3817
|
@@ -43,5 +22,5 @@ LL | | .cloned()
4322
LL | | .collect();
4423
| |______________________^ help: try: `.to_vec()`
4524

46-
error: aborting due to 5 previous errors
25+
error: aborting due to 3 previous errors
4726

tests/ui/let_underscore_drop.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: non-binding let on a type that implements `Drop`
1+
error: non-binding `let` on a type that implements `Drop`
22
--> $DIR/let_underscore_drop.rs:16:5
33
|
44
LL | let _ = Box::new(());
@@ -7,15 +7,15 @@ LL | let _ = Box::new(());
77
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
88
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
99

10-
error: non-binding let on a type that implements `Drop`
10+
error: non-binding `let` on a type that implements `Drop`
1111
--> $DIR/let_underscore_drop.rs:17:5
1212
|
1313
LL | let _ = Droppable;
1414
| ^^^^^^^^^^^^^^^^^^
1515
|
1616
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
1717

18-
error: non-binding let on a type that implements `Drop`
18+
error: non-binding `let` on a type that implements `Drop`
1919
--> $DIR/let_underscore_drop.rs:18:5
2020
|
2121
LL | let _ = Some(Droppable);

tests/ui/map_clone.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![warn(clippy::all, clippy::pedantic)]
33
#![allow(clippy::iter_cloned_collect)]
44
#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
5+
#![allow(clippy::let_underscore_drop)]
56
#![allow(clippy::missing_docs_in_private_items)]
67
#![allow(clippy::redundant_closure_for_method_calls)]
78
#![allow(clippy::many_single_char_names)]

tests/ui/map_clone.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#![warn(clippy::all, clippy::pedantic)]
33
#![allow(clippy::iter_cloned_collect)]
44
#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
5+
#![allow(clippy::let_underscore_drop)]
56
#![allow(clippy::missing_docs_in_private_items)]
67
#![allow(clippy::redundant_closure_for_method_calls)]
78
#![allow(clippy::many_single_char_names)]

0 commit comments

Comments
 (0)