Skip to content

Simplify the arguments to macros generated by the rustc_queries proc macro #100946

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

Merged
merged 6 commits into from
Aug 27, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Aug 24, 2022

Very small cleanup. Based on #100436 which modifies some of the same code.

r? @cjgillot

jyn514 added 6 commits August 23, 2022 21:33
It's not actually necessary and it makes the code harder to read.
Rustdoc documents these with the name of the type alias instead of normalizing them to the underlying type.
Use associated types instead so that the generated docs for nightly-rustc are easier to read.
This should both make the code easier to read and also greatly reduce the amount of codegen
the compiler has to do, since it only needs to monomorphize `create_query_frame` for each
new key and not for each query.
- Disallow multiple macros callbacks in the same invocation. In practice, this was never used.
- Remove the `[]` brackets around the macro name
- Require an `ident`, not an arbitrary `tt`
@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) labels Aug 24, 2022
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2022
@cjgillot
Copy link
Contributor

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Aug 24, 2022

📌 Commit b061550 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 Aug 24, 2022
@bjorn3
Copy link
Member

bjorn3 commented Aug 24, 2022

#100436 hasn't yet been merged.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 24, 2022
@jyn514 jyn514 added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2022
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 25, 2022

📌 Commit b061550 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-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Aug 25, 2022
@bors
Copy link
Collaborator

bors commented Aug 27, 2022

⌛ Testing commit b061550 with merge 4065b89...

@klensy
Copy link
Contributor

klensy commented Aug 27, 2022

This not rebased over #100436, so first 4 comments doubled.

@bors
Copy link
Collaborator

bors commented Aug 27, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 4065b89 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 27, 2022
@bors bors merged commit 4065b89 into rust-lang:master Aug 27, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 27, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4065b89): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [1.2%, 1.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.3% [-3.9%, -2.7%] 2
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -3.3% [-3.9%, -2.7%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
1.8% [1.8%, 1.8%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-1.8%, -1.8%] 1
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) 0.0% [-1.8%, 1.8%] 2

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@jyn514 jyn514 deleted the query-system-3 branch August 28, 2022 14:26
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) C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. 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.

8 participants