Skip to content

Commit

Permalink
Update references
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Nov 8, 2020
1 parent 40d7af5 commit 06e81bb
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 506 deletions.
11 changes: 1 addition & 10 deletions tests/ui/borrow_box.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
LL | fn test4(a: &Box<bool>);
| ^^^^^^^^^^ help: try: `&bool`

error: non-binding let on a type that implements `Drop`
--> $DIR/borrow_box.rs:63:5
|
LL | let _ = foo;
| ^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
--> $DIR/borrow_box.rs:95:25
|
Expand Down Expand Up @@ -73,5 +64,5 @@ error: you seem to be trying to use `&Box<T>`. Consider using just `&T`
LL | pub fn test20(_display: &Box<(dyn Display + Send)>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn Display + Send)`

error: aborting due to 11 previous errors
error: aborting due to 10 previous errors

27 changes: 1 addition & 26 deletions tests/ui/borrow_interior_mutable_const/others.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
|
= help: assign this const to a local or static variable, and use the variable here

error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:72:5
|
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:72:14
|
Expand Down Expand Up @@ -104,22 +95,6 @@ LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
|
= help: assign this const to a local or static variable, and use the variable here

error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:83:5
|
LL | let _ = ATOMIC_TUPLE.1.into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: non-binding let on a type that implements `Drop`
--> $DIR/others.rs:85:5
|
LL | let _ = &{ ATOMIC_TUPLE };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:87:5
|
Expand All @@ -136,5 +111,5 @@ LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
|
= help: assign this const to a local or static variable, and use the variable here

error: aborting due to 17 previous errors
error: aborting due to 14 previous errors

15 changes: 1 addition & 14 deletions tests/ui/box_vec.stderr
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
error: non-binding let on a type that implements `Drop`
--> $DIR/box_vec.rs:7:9
|
LL | let _: Box<$x> = Box::new($init);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | boxit!(Vec::new(), Vec<u8>);
| ---------------------------- in this macro invocation
|
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
--> $DIR/box_vec.rs:14:18
|
Expand All @@ -20,5 +7,5 @@ LL | pub fn test(foo: Box<Vec<bool>>) {
= note: `-D clippy::box-vec` implied by `-D warnings`
= help: `Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.

error: aborting due to 2 previous errors
error: aborting due to previous error

11 changes: 0 additions & 11 deletions tests/ui/crashes/ice-4968.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/crashes/ice-5223.stderr

This file was deleted.

23 changes: 1 addition & 22 deletions tests/ui/escape_analysis.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,5 @@ error: local variable doesn't need to be boxed here
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
| ^^^^^^^^^^^

error: non-binding let on a type that implements `Drop`
--> $DIR/escape_analysis.rs:166:9
|
LL | / let _ = move || {
LL | | consume(x);
LL | | };
| |__________^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: non-binding let on a type that implements `Drop`
--> $DIR/escape_analysis.rs:172:9
|
LL | / let _ = || {
LL | | borrow(&x);
LL | | };
| |__________^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: aborting due to 4 previous errors
error: aborting due to 2 previous errors

19 changes: 1 addition & 18 deletions tests/ui/eta.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ error: redundant closure found
LL | let e: std::vec::Vec<char> = vec!['a', 'b', 'c'].iter().map(|c| c.to_ascii_uppercase()).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `char::to_ascii_uppercase`

error: non-binding let on a type that implements `Drop`
--> $DIR/eta.rs:107:5
|
LL | let _: Vec<_> = arr.iter().map(|x| x.map_err(|e| some.take().unwrap()(e))).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: redundant closure found
--> $DIR/eta.rs:172:27
|
Expand All @@ -85,13 +76,5 @@ error: redundant closure found
LL | let a = Some(1u8).map(|a| closure(a));
| ^^^^^^^^^^^^^^ help: remove closure as shown: `closure`

error: non-binding let on a type that implements `Drop`
--> $DIR/eta.rs:203:5
|
LL | let _ = [Bar].iter().map(|s| s.to_string()).collect::<Vec<_>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: aborting due to 14 previous errors
error: aborting due to 12 previous errors

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

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

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

error: non-binding let on a type that implements `Drop`
error: non-binding `let` on a type that implements `Drop`
--> $DIR/filter_methods.rs:19:5
|
LL | / let _: Vec<_> = vec![5_i8; 6]
Expand Down
19 changes: 1 addition & 18 deletions tests/ui/get_unwrap.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -70,34 +70,17 @@ error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vecdeque[0]`

error: non-binding let on a type that implements `Drop`
--> $DIR/get_unwrap.rs:59:9
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:59:17
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: non-binding let on a type that implements `Drop`
--> $DIR/get_unwrap.rs:60:9
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:60:17
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `some_vec[0..1]`

error: aborting due to 15 previous errors
error: aborting due to 13 previous errors

11 changes: 1 addition & 10 deletions tests/ui/into_iter_on_ref.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
error: non-binding let on a type that implements `Drop`
--> $DIR/into_iter_on_ref.rs:13:5
|
LL | let _ = vec![1, 2, 3].into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec`
--> $DIR/into_iter_on_ref.rs:14:30
|
Expand Down Expand Up @@ -171,5 +162,5 @@ error: this `.into_iter()` call is equivalent to `.iter()` and will not consume
LL | let _ = (&[1, 2, 3]).into_iter().next(); //~ WARN equivalent to .iter()
| ^^^^^^^^^ help: call directly: `iter`

error: aborting due to 28 previous errors
error: aborting due to 27 previous errors

23 changes: 1 addition & 22 deletions tests/ui/iter_cloned_collect.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,12 @@ LL | let v2: Vec<isize> = v.iter().cloned().collect();
|
= note: `-D clippy::iter-cloned-collect` implied by `-D warnings`

error: non-binding let on a type that implements `Drop`
--> $DIR/iter_cloned_collect.rs:15:5
|
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(clippy::let_underscore_drop)]` on by default
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
--> $DIR/iter_cloned_collect.rs:15:38
|
LL | let _: Vec<isize> = vec![1, 2, 3].iter().cloned().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()`

error: non-binding let on a type that implements `Drop`
--> $DIR/iter_cloned_collect.rs:19:9
|
LL | / let _: Vec<u8> = std::ffi::CStr::from_ptr(std::ptr::null())
LL | | .to_bytes()
LL | | .iter()
LL | | .cloned()
LL | | .collect();
| |_______________________^
|
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

error: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable
--> $DIR/iter_cloned_collect.rs:20:24
|
Expand All @@ -43,5 +22,5 @@ LL | | .cloned()
LL | | .collect();
| |______________________^ help: try: `.to_vec()`

error: aborting due to 5 previous errors
error: aborting due to 3 previous errors

6 changes: 3 additions & 3 deletions tests/ui/let_underscore_drop.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: non-binding let on a type that implements `Drop`
error: non-binding `let` on a type that implements `Drop`
--> $DIR/let_underscore_drop.rs:16:5
|
LL | let _ = Box::new(());
Expand All @@ -7,15 +7,15 @@ LL | let _ = Box::new(());
= note: `-D clippy::let-underscore-drop` implied by `-D warnings`
= help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`

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

error: non-binding let on a type that implements `Drop`
error: non-binding `let` on a type that implements `Drop`
--> $DIR/let_underscore_drop.rs:18:5
|
LL | let _ = Some(Droppable);
Expand Down
1 change: 1 addition & 0 deletions tests/ui/map_clone.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![warn(clippy::all, clippy::pedantic)]
#![allow(clippy::iter_cloned_collect)]
#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
#![allow(clippy::let_underscore_drop)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::redundant_closure_for_method_calls)]
#![allow(clippy::many_single_char_names)]
Expand Down
1 change: 1 addition & 0 deletions tests/ui/map_clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![warn(clippy::all, clippy::pedantic)]
#![allow(clippy::iter_cloned_collect)]
#![allow(clippy::clone_on_copy, clippy::redundant_clone)]
#![allow(clippy::let_underscore_drop)]
#![allow(clippy::missing_docs_in_private_items)]
#![allow(clippy::redundant_closure_for_method_calls)]
#![allow(clippy::many_single_char_names)]
Expand Down
Loading

0 comments on commit 06e81bb

Please sign in to comment.