-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Merge generics and where predicates and prevent duplicates in where predicates #105183
Conversation
@@ -598,46 +598,130 @@ pub(crate) fn clean_generics<'tcx>( | |||
}) | |||
.collect::<Vec<_>>(); | |||
|
|||
let mut bound_predicates = FxIndexMap::default(); |
There was a problem hiding this comment.
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.
4d443a9
to
d6ceaf9
Compare
d6ceaf9
to
269704a
Compare
// 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 { |
There was a problem hiding this comment.
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.
@bors r+ rollup=iffy Seems like it might cause a perf impact. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4bb1575): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
|
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