Skip to content

[let_underscore_untyped]: fix false positive on async function #12400

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

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented Mar 2, 2024

changelog: [let_underscore_untyped]: fix false positive on async function

Fix #12395

@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 2, 2024
@@ -200,7 +200,7 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore {
}

// Ignore if it is from a procedural macro...
if is_from_proc_macro(cx, init) {
if is_from_proc_macro(cx, init) || init.span.from_expansion() {
Copy link
Member

Choose a reason for hiding this comment

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

Let's check if local.source is Normal at the top of the function since it would be fine to lint let _ = some_macro!();, we can remove the default_binding_modes check also in that case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I hadn't noticed the source field. Done.

@Alexendoo
Copy link
Member

Thanks! @bors r+

@bors
Copy link
Contributor

bors commented Mar 3, 2024

📌 Commit 1df2854 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 3, 2024

⌛ Testing commit 1df2854 with merge 28e11b3...

@bors
Copy link
Contributor

bors commented Mar 3, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 28e11b3 to master...

@bors bors merged commit 28e11b3 into rust-lang:master Mar 3, 2024
@samueltardieu samueltardieu deleted the issue-12395 branch September 2, 2024 07:48
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.

let_underscore_untyped false positive when using _ as a parameter name in an async function
4 participants