-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix early lints inside an async desugaring #81541
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
Conversation
r? @varkor (rust-highfive has picked a reviewer for you, use r? to override) |
I see @petrochenkov assigned themselves, so I'll defer the review to them. (@petrochenkov: feel free to reassign me if you don't want to take it.) |
@varkor I mostly wanted to be aware of the changes in this area and assigned myself to not forget. |
f112bc6
to
ab1d400
Compare
Fixes rust-lang#81531 When we buffer an early lint for a macro invocation, we need to determine which NodeId to take the lint level from. Currently, we use the `NodeId` of the closest def parent. However, if the macro invocation is inside the desugared closure from an `async fn` or async closure, that `NodeId` does not actually exist in the AST. This commit explicitly calls `check_lint` for the `NodeId`s of closures desugared from async expressions, ensuring that we do not miss any buffered lints.
ab1d400
to
a74b2fb
Compare
@petrochenkov: I've updated the PR explicitly handle |
Thanks! |
📌 Commit a74b2fb has been approved by |
☀️ Test successful - checks-actions |
Fixes #81531
When we buffer an early lint for a macro invocation,
we need to determine which NodeId to take the lint level from.
Currently, we use the NodeId of the closest def parent. However, if
the macro invocation is inside the desugared closure from an
async fn
or async closure, that NodeId does not actually exist in the AST.
This commit uses the parent of a desugared closure when computing
lint_node_id
, which is something that actually exists in the AST (anasync fn
or async closure).