Do not suggest compatible variants inside macro#142611
Do not suggest compatible variants inside macro#142611xizheyin wants to merge 2 commits intorust-lang:mainfrom
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 <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
| 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. |
Fixes #142359
r? compiler