Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upInclude scope names in diagnostics #49898
Conversation
rust-highfive
assigned
eddyb
Apr 12, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
Apr 12, 2018
This comment has been minimized.
This comment has been minimized.
|
I opened a pre-RFC for this. https://internals.rust-lang.org/t/pre-rfc-include-scope-names-in-diagnostics/7304 . Will rewrite the implementation to suite the consensus from discussion. |
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
nikomatsakis
and unassigned
eddyb
Apr 17, 2018
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Ping from triage @nikomatsakis! This PR needs your review! |
This comment has been minimized.
This comment has been minimized.
|
Some thoughts:
I do agree that this information is valuable, but I think I would prefer an alternate presentation. I'd also prefer for us to gather the information in a different way. I think however I'll move my concerns over to the internals thread. I'm going to mark this PR as S-blocked for the time being -- however, I'm sort of inclined to close it, just because my queue is long and we're not ready to move here yet. But I'll hold off on that for now. |
nikomatsakis
added
S-blocked
and removed
S-waiting-on-review
labels
Apr 25, 2018
This comment has been minimized.
This comment has been minimized.
shepmaster
added
S-blocked
and removed
S-blocked
labels
May 6, 2018
pietroalbini
added
S-blocked
and removed
S-blocked
labels
May 14, 2018
da-x
force-pushed the
da-x:scope-names-in-diagnostics
branch
2 times, most recently
from
14857fa
to
92dd733
May 15, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
da-x
force-pushed the
da-x:scope-names-in-diagnostics
branch
from
92dd733
to
30c21ad
May 16, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis - reminded you pinged about this. When we designed the current error messages, we did go through an iteration of giving more information about the location. When we did our original survey of developers, many said the first they they look for is the file and line number. After seeing this pattern, we simplified the idea down to have the file and line number on a line by itself. The drawback of this proposal is that it loses some of that, and it makes it more difficult to, at-a-glance, catch the file and line number for those types of developers. |
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
da-x
added some commits
May 16, 2018
da-x
force-pushed the
da-x:scope-names-in-diagnostics
branch
from
6efc19e
to
5de482c
May 17, 2018
This comment has been minimized.
This comment has been minimized.
|
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This comment has been minimized.
This comment has been minimized.
|
Because I have so many dang PRs pending, I'm going to close this pending any final decision (we can always re-open!). I think my post on the internals thread (which I confess I've been too slammed to keep up with) still represents my opinion. |
nikomatsakis
closed this
May 17, 2018
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Thanks! I am going to prepare an RFC based on all the comments. |
da-x commentedApr 12, 2018
•
edited
Pre-RFC: rust-lang/rfcs#2399
So far, rustc has only printed about filenames and line numbers for warnings and errors. I think it is rather missed, compared to
gccand other compiler, that useful context information such as functionnames and structs is not included.
The changes in this pull request introduce new emissions in diagnostics to implement this.
Short example:
Check
in fn testabove.The information for the line is gathered by a mechanism to resolve a
Spanto the corresponding named scope, by a Trait dynamic call fromlibrustc_errorback tolibsyntax, in addition to what is done withCodeMap. The call does a quick DFS into the AST for theSpanand collects the relevantIdentpath, so it should handle nested scopes properly.To do:
AST prior to macro expansion?
A larger example:
The output is: