-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
Not sure if it's not a duplicate of some issue, there are a lot of tickets, but this still seems distinct. Tested both on nightly and stable.
~/k/pastebinrun (master|✔) $ cargo clippy -V
clippy 0.0.212 (082cfa7 2019-06-07)
~/k/pastebinrun (master|✔) $ cargo +nightly clippy -V
clippy 0.0.212 (b041511 2019-08-07)
Sample code:
fn callbacker(_: impl Fn(&mut [u8])) {}
fn g<W>(_: W) {}
fn main() {
callbacker(|w| g(w));
}
Causes the following warning.
Checking playground v0.0.1 (/playground)
warning: redundant closure found
--> src/main.rs:4:16
|
4 | callbacker(|w| g(w));
| ^^^^^^^^ help: remove closure as shown: `g`
|
= note: `#[warn(clippy::redundant_closure)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
The closure cannot be removed as shown.
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied