Uh oh!
There was an error while loading. Please reload this page.
resolve: Do not use "resolve"/"resolution" in error messages - #38890
Conversation
GuillaumeGomez
commented
Jan 7, 2017
Seems good for me. Thanks for your work! |
eddyb
commented
Jan 8, 2017
I like the idea of changing the wording for better readability. I'm not 100% yet on "value Curious to hear what @nikomatsakis thinks, but how does "value |
nrc
commented
Jan 9, 2017
LGTM, I like the wording. @jonathandturner I feel like 'declared' and 'scope' are not as bad as 'resolution' - the former are programming jargon, but the latter is compiler jargon. So while it is not perfect, it is much better. I'm wary about using 'visible' since it seems easy to confuse with visibility (is a variable declared in a scope, vs is the variable accessible from that scope). r=me, but leaving open for a few days for discussion of wording. |
nikomatsakis
commented
Jan 9, 2017
Strong 👍 on shifting away from "resolved". I have to admit I find it hard to imagine not knowing the word "declaration", but I can appreciate that I am biased and that this might well be the case for some users! That said, I don't like the precise wording of "value Foo is not visible from here" -- the problem is that, to me, that implies that |
Compare messages for
In the second case we tell that we can't find |
eddyb
commented
Jan 10, 2017
What about "cannot find ... in scope"? With the notes being about something with that name being "found elsewhere". This seems better than mentioning declarations which can be confusing wrt imports and other things. |
petrochenkov
commented
Jan 10, 2017
Base 1: LGTM (except for label 2), but I have nothing against "declared" so I like my variant better. |
nikomatsakis
commented
Jan 10, 2017
@petrochenkov one think that gives me pause about "declared" is that I think of a declaration as being something like |
nikomatsakis
commented
Jan 10, 2017
I think mentioning |
petrochenkov
commented
Jan 10, 2017
I'm still interested in better suggestions for "Label 2". |
sophiajt
commented
Jan 10, 2017
@petrochenkov what an example for label 2? I see the pattern, but what does it look like a real example? |
@jonathandturner Diagnostics: (Note that path segments don't have individual spans now, so the label has to point to the whole path.) |
sophiajt
commented
Jan 10, 2017
I think it's okay to also use "not in scope" here, too |
I wonder why this isn't/can't be "cannot find value EDIT:
We should just fix this, it's been bothering me for other reasons (per-segment lifetime/type parameters). |
Oh, that's just a typo (I modified the error message manually), fixed.
Ok, I'll use "not in |
bors
commented
Jan 11, 2017
☔ The latest upstream changes (presumably #38925) made this pull request unmergeable. Please resolve the merge conflicts. |
nikomatsakis
commented
Jan 11, 2017
New messages are looking good. 👍 |
petrochenkov
commented
Jan 11, 2017
Updated. |
nrc
commented
Jan 12, 2017
@bors: r+ |
bors
commented
Jan 12, 2017
📌 Commit 2c6fa8a has been approved by |
petrochenkov
commented
Jan 12, 2017
Fixed wrongly updated UI test caught by travis |
bors
commented
Jan 12, 2017
📌 Commit 2092682 has been approved by |
bors
commented
Jan 13, 2017
⌛ Testing commit 2092682 with merge 2768428... |
bors
commented
Jan 13, 2017
💔 Test failed - status-appveyor |
dist failure (appveyor s3 bindings) |
bors
commented
Jan 13, 2017
⌛ Testing commit 2092682 with merge 31f0c9d... |
bors
commented
Jan 13, 2017
💔 Test failed - status-travis |
alexcrichton
commented
Jan 13, 2017
@bors: retry
|
bors
commented
Jan 13, 2017
⌛ Testing commit 2092682 with merge 3e5621b... |
bors
commented
Jan 13, 2017
⌛ Testing commit 2092682 with merge 1d5fb06... |
resolve: Do not use "resolve"/"resolution" in error messages Use less jargon-y wording instead. `cannot find <struct> <S> in <this scope>` and `cannot find <struct> <S> in <module a::b>` are used for base messages (this also harmonizes nicely with "you can import it into scope" suggestions) and `not found in <this scope>` and `not found in <a::b>` are used for short labels in fall-back case. I tweaked some other diagnostics to avoid using "resolve" (see, e.g., `librustc_resolve/macros.rs`), but haven't touched messages for imports. Closes#38750 r? @nrc
bors
commented
Jan 13, 2017
☀️ Test successful - status-appveyor, status-travis |
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixesrust-lang#38927 (comment)rust-lang#38890 (comment) r? @nrc@eddyb
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixesrust-lang#38927 (comment)rust-lang#38890 (comment) r? @nrc@eddyb
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixesrust-lang#38927 (comment)rust-lang#38890 (comment) r? @nrc@eddyb
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixesrust-lang#38927 (comment)rust-lang#38890 (comment) r? @nrc@eddyb
Give spans to individual path segments in AST And use these spans in path resolution diagnostics. The spans are spans of identifiers in segments, not whole segments. I'm not sure what spans are more useful in general, but identifier spans are a better fit for resolve errors. HIR still doesn't have spans. Fixesrust-lang#38927 (comment)rust-lang#38890 (comment) r? @nrc@eddyb
Use less jargon-y wording instead.
cannot find <struct> <S> in <this scope>andcannot find <struct> <S> in <module a::b>are used for base messages (this also harmonizes nicely with "you can import it into scope" suggestions) andnot found in <this scope>andnot found in <a::b>are used for short labels in fall-back case.I tweaked some other diagnostics to avoid using "resolve" (see, e.g.,
librustc_resolve/macros.rs), but haven't touched messages for imports.Closes#38750
r? @nrc