Do not suggest compatible variants inside macro#142611
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 |
740b701 to
6f33a8f
Compare
| 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.
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.
|
your first commit hasn't even reproduced the issue, please make sure you can reproduce it before attempting a fix |
|
if the ui test environment doesn't provide std sources, then we need a configuration that does provide std sources to reproduce |
This comment was marked as outdated.
This comment was marked as outdated.
|
I open #144585 to provide std sources in ui tests. |
Does this actually need std sources? Can you use an auxiliary such that to the main test, it would be considered e.g. from external macro? (As @estebank recommends in #131782 (comment)) |
|
I seem to have find the problem. The root of the problem seems to be the different implementations of |
|
r? jieyouxu |
|
The regression test doesn't reproduce the regression yet so |
|
Yeah, since #144585 hasn't been finalized yet, I'll reproduce it by defining extern crate in the UI test. |
|
@xizheyin any updates on this? thanks |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Updated the regression test to use an auxiliary external macro. The first commit suggests editing inside the external macro, while second commit fix it making it stays at the macro callsite. @rustbot ready |
Fixes #142359
r? compiler