Move and expand the big rustc_query_impl macro into a physical query_impl.rs#153760
Open
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Open
Move and expand the big rustc_query_impl macro into a physical query_impl.rs#153760Zalathar wants to merge 2 commits intorust-lang:mainfrom
rustc_query_impl macro into a physical query_impl.rs#153760Zalathar wants to merge 2 commits intorust-lang:mainfrom
Conversation
Member
Author
|
cc @Zoxc @zetanumbers on this structural change to The idea of splitting off the big macro has some overlap with the ideas in #151977, but I think the key insight of this PR is that there's a lot of benefit from defining and expanding the macro in the same module. |
This comment has been minimized.
This comment has been minimized.
Moving the macro and its expansion into the same physical file resolves a lot of tension in the current module arrangement. Code in the macro is now free to use plain imports in the same file, and there is no longer any question of whether `mod query_impl` should be declared inside the macro, or surrounding a separate expansion site.
Contributor
|
☔ The latest upstream changes (presumably #153770) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While looking through #153588, I came up with a related but different change that I think resolves a lot of tension in the current module arrangement.
The core idea is that if we both define and expand the big macro in the same physical module
rustc_query_impl::query_impl, then we no longer need to worry about wheremod query_implshould be declared, or where its imports should go, because those questions now have simple and obvious answers.The second commit follows up with some more changes inspired by #153588. Those particular follow-ups are not essential to the main idea of this PR.
r? nnethercote