-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Do not suggest compatible variants inside macro #142611
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
base: master
Are you sure you want to change the base?
Conversation
The test doesn't seem to actually reproduce the issue that this fixes? It never suggested to modify std in the first commit. What's up with that |
This may be because #139316 (comment). |
r? compiler |
Signed-off-by: xizheyin <[email protected]>
Signed-off-by: xizheyin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rustbot ready
while let hir::ExprKind::Block(block, _) = &expr.kind | ||
&& let Some(expr_) = &block.expr | ||
// Only traverse blocks in same context | ||
&& expr_.span.eq_ctxt(expr.span) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This time, I find the deepest expression in the block tree while staying within the same context. This ensures that suggestions point to user-visible code.
Fixes #142359
r? compiler