-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add note when item accessed from module via m.i
rather than m::i
.
#30413
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
gaar I posted this before running (update: fixed that and the typo in the unit test; |
cac02ed
to
6946995
Compare
I'm still working on adding the two missing additional information. |
(and I think we do not need to block this PR on that change.) |
@GuillaumeGomez Just to be clear: The reason that I turned #30356 into this PR was that I was concerned that it was giving "bad hints" in some contexts.
I wrote up the examples you noted as ways to illustrate cases where #30356 would give bad hints. But I did not intend to imply something like "we should wait until we have solved all of these cases before we land anything." My intention in this PR was to continue to solve the same narrow problem that #30356 was trying to solve, but to do it in a more targeted fashion that ensures that we only provide in hint about I definitely encourage you to try to come up with good error messages for other cases that this PR does not cover. You should do that work and put it up as a separate PR. |
@@ -202,6 +202,12 @@ pub enum ResolutionError<'a> { | |||
AttemptToUseNonConstantValueInConstant, | |||
} | |||
|
|||
#[derive(Clone, PartialEq, Eq, Debug)] | |||
pub enum UnresolvedNameContext { |
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.
Could you add a doc comment on this so it's not confusing for future hackers?
(Also explain what the nodeid is)
r=me with nit |
This should also solve #22692 ? |
I don't think I'm going to try to do that. :) |
⌛ Testing commit 04c05c7 with merge ea6e312... |
💔 Test failed - auto-win-gnu-32-opt |
What the heck, a bunch of errors in |
@bors: retry On Sun, Dec 20, 2015 at 4:38 AM, Felix S Klock II notifications@github.com
|
Add note when item accessed from module via `m.i` rather than `m::i`. (I tried to make this somewhat future-proofed, in that the `UnresolvedNameContext` could be expanded in the future with other cases besides paths that are known to be modules.) This supersedes PR #30356 ; since I'm responsible for a bunch of new code here, someone else should review it. :)
Add note when item accessed from module via
m.i
rather thanm::i
.(I tried to make this somewhat future-proofed, in that the
UnresolvedNameContext
could be expanded in the future with other cases besides paths that are known to be modules.)This supersedes PR #30356 ; since I'm responsible for a bunch of new code here, someone else should review it. :)