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 generics and where predicates and prevent duplicates in where predicates #105183

Merged
merged 3 commits into from
Dec 3, 2022

Conversation

GuillaumeGomez
Copy link
Member

Part of #104886 (I didn't include bounds from parent trait yet as I think the PR is already big enough).

Also we'll need to run a perf check.

cc @fmease since you worked a bit on this.
r? @notriddle

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 2, 2022
@@ -598,46 +598,130 @@ pub(crate) fn clean_generics<'tcx>(
})
.collect::<Vec<_>>();

let mut bound_predicates = FxIndexMap::default();
Copy link
Member Author

Choose a reason for hiding this comment

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

I used FxIndexMap to keep the order of predicates.

@GuillaumeGomez GuillaumeGomez force-pushed the merge-and-dedup-predicates branch from 4d443a9 to d6ceaf9 Compare December 2, 2022 18:40
@GuillaumeGomez GuillaumeGomez force-pushed the merge-and-dedup-predicates branch from d6ceaf9 to 269704a Compare December 2, 2022 18:40
// Some duplicates are generated for ?Sized bounds between type params and where
// predicates. The point in here is to move the bounds definitions from type params
// to where predicates when such cases occur.
for where_pred in &mut generics.where_predicates {
Copy link
Member Author

@GuillaumeGomez GuillaumeGomez Dec 2, 2022

Choose a reason for hiding this comment

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

It seems like this whole block was not necessary anymore with my dedup changes above.

@notriddle
Copy link
Contributor

@bors r+ rollup=iffy

Seems like it might cause a perf impact.

@bors
Copy link
Collaborator

bors commented Dec 3, 2022

📌 Commit 269704a has been approved by notriddle

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 Dec 3, 2022
@bors
Copy link
Collaborator

bors commented Dec 3, 2022

⌛ Testing commit 269704a with merge 4bb1575...

@bors
Copy link
Collaborator

bors commented Dec 3, 2022

☀️ Test successful - checks-actions
Approved by: notriddle
Pushing 4bb1575 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 3, 2022
@bors bors merged commit 4bb1575 into rust-lang:master Dec 3, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 3, 2022
@GuillaumeGomez GuillaumeGomez deleted the merge-and-dedup-predicates branch December 3, 2022 15:08
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4bb1575): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-3.3%, -1.7%] 2
All ❌✅ (primary) - - 0

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.6% [1.3%, 1.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-rustdoc Relevant to the rustdoc 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