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

let_unit_value still has a false positive when the expression is an async function with a generic return type #10455

Closed
booleancoercion opened this issue Mar 5, 2023 · 3 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied

Comments

@booleancoercion
Copy link
Contributor

Summary

Similarly to the last comment in #8998 before it was closed, this lint is emitted in error, since the let binding is used to specify the return type in this case. Satisftying the lint by removing the let binding altogether causes a compiler error.

Lint Name

let_unit_value

Reproducer

pub async fn generic<T>() -> T {
    unimplemented!()
}

pub async fn calling_generic() {
    let () = generic().await;
}

Version

Occurs on the playground on both stable 1.67.1 and nightly 1.70.

Additional Labels

@rustbot label +l-suggestion-causes-error

@booleancoercion booleancoercion added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Mar 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2023

Error: Label l-suggestion-causes-error can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@Alexendoo Alexendoo added the I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied label Mar 5, 2023
@Jarcho
Copy link
Contributor

Jarcho commented Mar 5, 2023

This was fixed in #10439

@Jarcho Jarcho closed this as completed Mar 5, 2023
@booleancoercion
Copy link
Contributor Author

My bad, that issue was a bit hard to look up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have I-suggestion-causes-error Issue: The suggestions provided by this Lint cause an ICE/error when applied
Projects
None yet
Development

No branches or pull requests

4 participants