-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc_resolve: Refactor away NameBindings and ImportResolutionPerNamespace #30843
Conversation
a778203
to
07df703
Compare
I amended the commit to add a couple of comments and refactored some more code out of |
☔ The latest upstream changes (presumably #30883) made this pull request unmergeable. Please resolve the merge conflicts. |
043c4fd
to
7f3f96a
Compare
☔ The latest upstream changes (presumably #30929) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry for the delay in reviewing this! Working on it. Been a crazy week. |
☔ The latest upstream changes (presumably #31010) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #30882) made this pull request unmergeable. Please resolve the merge conflicts. |
708e175
to
6865bff
Compare
@nikomatsakis No hurry, those first two upstream changes were PRs I backported from this branch and the other two didn't interact with this PR that much. Let me know if you'd like me to explain, motivate, or justify the purity of anything in this refactoring. I also have a branch a commit ahead of this one (diff) where I refactor away |
@jseyfried as you can tell I still haven't gotten to it :) I hope to do so soon though. Last week was just a doozy. (The truth is, I don't know resolve as well as I would like, so your PRs always require me to read into the code quite a bit.) UPDATE: But it's good for me. :) |
|
@petrochenkov good points, thanks. I implemented your suggestions in the third commit. |
jseyfried@521aaf2 reviewed, all the code seems to be moved correctly, it's hard to track though |
ab53df5
to
100a9f6
Compare
OK, I feel pretty good about this change. @petrochenkov, your thoughts? |
resolve becomes 450 lines less scary, merge of course! |
☔ The latest upstream changes (presumably #31212) made this pull request unmergeable. Please resolve the merge conflicts. |
OK, r=me after a rebase. Just for fun, I kicked off a crater run as well (resolve tends to be finicky). |
…icateCheckingMode, and NamespaceDefinition.
rebased |
Crater report shows zero regressions: https://gist.github.com/nikomatsakis/5181cff5cc53438ab82e |
@bors r+ |
📌 Commit afd42d2 has been approved by |
⌛ Testing commit afd42d2 with merge 9ba9f0a... |
💔 Test failed - auto-mac-64-nopt-t |
@bors: retry On Fri, Jan 29, 2016 at 7:42 PM, bors notifications@github.com wrote:
|
⌛ Testing commit afd42d2 with merge 558fd51... |
💔 Test failed - auto-linux-cross-opt |
@bors: retry On Fri, Jan 29, 2016 at 8:48 PM, bors notifications@github.com wrote:
|
This commit refactors the field `Module::children` from mapping `Name` -> `NameBindings` to mapping `(Name, Namespace)` -> `NameBinding` and refactors the field `Module::import_resolutions` from mapping `Name` -> `ImportResolutionPerNamespace` to mapping `(Name, Namespace)` -> `ImportResolution`. This allows the duplicate checking code to be refactored so that `NameBinding` no longer needs ref-counting or a RefCell (removing the need for `NsDef`). r? @nikomatsakis
This commit refactors the field
Module::children
from mappingName
->NameBindings
to mapping(Name, Namespace)
->NameBinding
and refactors the fieldModule::import_resolutions
from mappingName
->ImportResolutionPerNamespace
to mapping(Name, Namespace)
->ImportResolution
.This allows the duplicate checking code to be refactored so that
NameBinding
no longer needs ref-counting or a RefCell (removing the need forNsDef
).r? @nikomatsakis