-
Notifications
You must be signed in to change notification settings - Fork 899
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
Module refactors #6062
base: master
Are you sure you want to change the base?
Module refactors #6062
Conversation
1ff061a
to
eb23a15
Compare
eb23a15
to
2640a40
Compare
I'd like to land #5611 before taking a look at these changes. I'm not 100% sure if that will impact what you're trying to do here but I wanted to give you a heads up |
Make it so the field is only modified through a with_directory function so that it is easier to follow.
It's a little tricky to follow, but if you trace the code paths for inline modules and for external modules, this value is never actually used. This makes two functions more similar so that they can be deduped in a later commit.
This variant can be factored out fairly easily. It makes things simpler overall and opens the door for later refactors.
This makes some code DRYer since we don't need to use Cows and have different code paths for items with different lifetimes.
Defer creating a Module until needed. This is possible now that we are using arenas, so ast Items have the 'ast lifetime.
At this point it is just redundant with Module.items.
2640a40
to
ba2f38d
Compare
I removed some commits to keep this PR focused on a series of related changes. I also took things a bit further by introducing an arena. I think this ultimately makes things simpler overall. I also added explanations on most individual commit messages. (I know we're waiting on #5611. It looks like that will be a pretty simple git conflict.) |
A set of refactors, mostly around modules.rs to make code DRYer and simpler. Review one commit at a time and note that some commits are prep work for later commits.