-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Move the query list into a new rustc_middle::queries module
#151893
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
|
rustbot has assigned @petrochenkov. Use |
|
This appears to be the first step of a much larger change that would definitely need an MCP. |
|
Just to clarify, I think this makes sense whether or not we want to let other crates define queries. It would just be additional motivation to do so. |
|
I don't like Is the |
It's quite useful. We'd want to keep it in an fresh submodule to avoid naming conflicts. Maybe just |
|
What naming conflicts could occur? Isn't the point of the |
|
Yeah, I guess we could just keep the new top-level |
|
Actually the proc macro generates some modules which may conflict. |
|
What are the conflicting modules? |
|
r? @nnethercote |
|
We have 3 modules each defining a |
This comment has been minimized.
This comment has been minimized.
|
The The There's also all of these: Is that avoidable? Ideally the |
The macro could probably just use full paths for these instead. |
|
In case it wasn't clear: I would prefer |
|
Ah, I though at first you were referring to the extra imports in the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I guess the argument is that @bors r+ |
|
Conceptually the types would be defined in |
|
In general I think it's premature to make sweeping changes based on the ambition of splitting query declarations across multiple crates, because that's an MCP-level change that I still have a lot of reservations about. However, in this particular case pulling the query declarations out of So I guess this is fine? |
|
EDIT: Though looking at the squashed PR diff, the separation does seem to be necessary to properly preserve the move, so I guess this is one of those exceptional cases after all. Similarly, I don't like to see unnecessary indentation changes in the fixups. While Git tools can sometimes deal with that, it still adds an unwelcome layer of noise when trying to make sense of history. |
Move the query list into a new `rustc_middle::queries` module This moves the query list from `rustc_middle::query` into a new `rustc_middle::queries` module. This splits up the use of the query system from the remaining implementation of it in `rustc_middle::query`, which conceptually belong to `rustc_query_system`. The goal is to let rustc crates define queries with their own `queries` module, and this makes `rustc_middle` also fit this pattern. The inner `queries` module used by the macros are renamed to `query_info`, so it doesn't conflict with the new outer name.
Move the query list into a new `rustc_middle::queries` module This moves the query list from `rustc_middle::query` into a new `rustc_middle::queries` module. This splits up the use of the query system from the remaining implementation of it in `rustc_middle::query`, which conceptually belong to `rustc_query_system`. The goal is to let rustc crates define queries with their own `queries` module, and this makes `rustc_middle` also fit this pattern. The inner `queries` module used by the macros are renamed to `query_info`, so it doesn't conflict with the new outer name.
In #151943 I intend to rename Regarding the flattened |
…uwer Rollup of 5 pull requests Successful merges: - #151893 (Move the query list into a new `rustc_middle::queries` module) - #152060 (ci: Optimize loongarch64-linux dist builders) - #151993 (Add uv to the list of possible python runners) - #152047 (Convert to inline diagnostics in `rustc_interface`) - #152053 (Avoid semicolon suggestion when tail expr is error) Failed merges: - #152023 (Some `rustc_query_system` cleanups)
This moves the query list from
rustc_middle::queryinto a newrustc_middle::queriesmodule. This splits up the use of the query system from the remaining implementation of it inrustc_middle::query, which conceptually belong torustc_query_system.The goal is to let rustc crates define queries with their own
queriesmodule, and this makesrustc_middlealso fit this pattern.The inner
queriesmodule used by the macros are renamed toquery_info, so it doesn't conflict with the new outer name.