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

Add new lint [let_underscore_future] #9760

Merged
merged 8 commits into from
Nov 5, 2022

Conversation

SquareMan
Copy link
Contributor

@SquareMan SquareMan commented Oct 31, 2022

This closes #9721

changelog: add new lint [let_underscore_future]

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 31, 2022
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good apart from a few small nits.

clippy_lints/src/let_underscore.rs Outdated Show resolved Hide resolved
clippy_lints/src/let_underscore.rs Outdated Show resolved Hide resolved
@SquareMan SquareMan requested a review from llogiq November 1, 2022 21:27
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we missed one let in the lint message. Apart from that this is good to merge.

clippy_lints/src/let_underscore.rs Outdated Show resolved Hide resolved
@SquareMan SquareMan requested a review from llogiq November 5, 2022 04:00
@SquareMan
Copy link
Contributor Author

Took a couple tries to fix the test files but looks like we're good now.

@llogiq
Copy link
Contributor

llogiq commented Nov 5, 2022

Thank you! And sorry for the inconvenience.

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 5, 2022

📌 Commit 7c5b188 has been approved by llogiq

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Nov 5, 2022

⌛ Testing commit 7c5b188 with merge d15e5e6...

@bors
Copy link
Collaborator

bors commented Nov 5, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing d15e5e6 to master...

@bors bors merged commit d15e5e6 into rust-lang:master Nov 5, 2022
@SquareMan SquareMan deleted the let_underscore_future branch November 6, 2022 09:52
bors added a commit that referenced this pull request Mar 4, 2023
Downgrade let_underscore_untyped to restriction

From reading #6842 I am not convinced of the cost/benefit of this lint even as a pedantic lint.

It sounds like the primary motivation was to catch cases of `fn() -> Result` being changed to `async fn() -> Result`. If the original Result was ignored by a `let _`, then the compiler wouldn't guide you to add `.await`. **However, this situation is caught in a more specific way by [let_underscore_future](https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future) which was introduced _after_ the original suggestion (#9760).**

In #10410 it was mentioned twice that a <kbd>restriction</kbd> lint might be more appropriate for let_underscore_untyped.

changelog: Moved [`let_underscore_untyped`] to restriction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should assigning an unawaited future to let _ = ... be it's own lint?
4 participants