-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Suggest only Span without source changes when source code is unavailable #144585
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
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
Looks like jieyou is busy r? compiler |
This feels very sus. How does this handle stable vs beta vs nightly vs in-tree std sources? I feel like there's a reason why ui tests don't get to access std sources, which is to prevent different diagnostics depending on availability of std sources, and which std sources? |
Is it possible to normalize the content of the source code and just let us know that the source code is displayed in stderr? I'm curious what kind of impact different versions (stable/nightly/beta/in-tree) would have, I don't know enough about CI. Any examples of this? |
show-std-source
Signed-off-by: xizheyin <[email protected]>
fef27bc
to
1eb0f64
Compare
help: consider dereferencing here | ||
--> $SRC_DIR/core/src/macros/mod.rs:LL:COL | ||
|
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.
I've written up this change in the PR description above, and it should have a similar mechanism to span_note for now.
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.
I don't think we should be suggesting changes to code the user doesn't own, specially for stdlib. For a suggestion here it should be pointing at the parameters instead (which might be difficult to accomplish).
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.
Yes, this is exactly the problem we need to solve.
This pr is to solve the problem that UI test can't be reproduced to make suggestions in std. Being able to reproduce compiler bugs will make review easier.
This comment was marked as duplicate.
This comment was marked as duplicate.
Sorry, something went wrong.
For further explanation, I moved the comments here. When fixing the problems listed in #142403, we found that the bug could not be reproduced in ui test. After investigation, I found that span suggestion and span note are not realized in the same way, so I submitted this pr to make std visible in ui tests. In daily use, the source of std should be visible, and execution will fall to the else branch, so these will not be displayed. This new test is a bug recorded in #142403, only for verifying this code change, I will fix it in later pr. |
In order to be able to reproduce in ui tests the errors that rustc generates suggestions in std sources (essentially external macros), i.e. #142403, this PR make
emit_suggestion_default
suggest only the base information when source is not available and does not show the code change.Now it's something like
rust/tests/ui/wf/wf-impl-self-type.stderr
Lines 8 to 10 in 9ba00e0
cc #139316 (comment)
r? @jieyouxu