Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest changing closure on E0593 #52473

Closed
estebank opened this issue Jul 17, 2018 · 0 comments
Closed

Suggest changing closure on E0593 #52473

estebank opened this issue Jul 17, 2018 · 0 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@estebank
Copy link
Contributor

Given a call that expects a closure that accepts arguments being passed a closure that takes no arguments:

fn main() {
    Some(()).into_iter().filter(|| false).collect();
}

we might want to suggest modifying the closure to take the argument and ignore it:

fn main() {
    Some(()).into_iter().filter(|_| false).collect();
}

How often would this suggestion be inappropriate?

@estebank estebank added the A-diagnostics Area: Messages for errors, warnings, and lints label Jul 17, 2018
@csmoe csmoe self-assigned this Jul 23, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 26, 2018
Suggest to take and ignore args while closure args count mismatching

Closes rust-lang#52473
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

2 participants