-
Notifications
You must be signed in to change notification settings - Fork 170
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
NR2: Use parent scope instead of enum scope to resolve enum content #3430
base: master
Are you sure you want to change the base?
Conversation
gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: * resolve/rust-forever-stack.hxx: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): * resolve/rust-name-resolution-context.h: Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@powerboat9 anything to say about this ? I've taken a look at some of your PRs and I don't think you've introduced any "resolved from given scope" function right ? |
It doesn't look like it'll be quite that simple. I think skipping enum ribs when attempting to resolve the first segment of a path would do it. |
Exactly what I was looking for, a counter example. |
I don't think there's any reason for |
Can I try a fix? |
I've been on vacation for the past week hence the delayed answer/no activity on this PR, actually I'd like to tackle it myself. |
Oh, yeah, that's fine |
E2 (3) is resolved as E2 (2) instead of E2(1) because enum's scope has been pushed. In
Late::visit(TypePath &type)
we should map the usage to E2(1) definition.For now I'm trying to find an elegant solution (resolve the
TypePath
from it's scope's parent) but this should only work forEnum
(ReuseContextualVisitor
?).I'm not a fan of big forever stack modification, and obviously modifying it for that kind of edge case feels off.
resolve_from_parent
instead of that extra booleanShould fix nr2 test
exhaustiveness2.rs