Skip to content
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

Merge query property modules into one #111703

Merged
merged 1 commit into from
May 18, 2023
Merged

Merge query property modules into one #111703

merged 1 commit into from
May 18, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented May 18, 2023

This merges all the query modules that defines types into a single module per query with a normal naming convention for type aliases.

r? @cjgillot

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 18, 2023
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits and r=me

@@ -24,7 +24,7 @@ use rustc_hir::def::DefKind;
use rustc_hir::def_id::LocalDefId;
use rustc_interface::interface::Compiler;
use rustc_interface::{Config, Queries};
use rustc_middle::query::query_values::mir_borrowck;
use rustc_middle::query::queries::mir_borrowck::ProvidedValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should import the actual type from rustc_middle, not go through query type aliases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea is to avoid relying on the return type, but I'm not sure why.

value: query_provided::$name<'tcx>,
) -> Erase<query_values::$name<'tcx>> {
value: ProvidedValue<'tcx>,
) -> Erase<Value<'tcx>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably deserves an ErasedValue alias too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That saves just 1 character though.

@@ -503,11 +503,11 @@ macro_rules! define_queries {
pub(super) fn $name<'tcx>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we attempt to use the same convention in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 18, 2023

📌 Commit f6c6d10 has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 18, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request May 18, 2023
Merge query property modules into one

This merges all the query modules that defines types into a single module per query with a normal naming convention for type aliases.

r? `@cjgillot`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2023
Rollup of 7 pull requests

Successful merges:

 - rust-lang#110986 (Delay a bug when overwriting fed value.)
 - rust-lang#111054 (Do not recover when parsing stmt in cfg-eval.)
 - rust-lang#111685 (Fix typo in bootstrap command description)
 - rust-lang#111686 (Retire is_foreign_item query.)
 - rust-lang#111695 (Exclude inherent projections from some alias type `match`es)
 - rust-lang#111703 (Merge query property modules into one)
 - rust-lang#111707 (Remove unused `impl<T> WorkerLocal<Vec<T>>`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cca0f97 into rust-lang:master May 18, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 18, 2023
@Zoxc Zoxc deleted the queries-mod branch May 18, 2023 22:07
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 20, 2023
Merge some query impl modules into one

This merges some modules in `rustc_query_impl` into one per query, analogous to rust-lang#111703.

r? `@cjgillot`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants