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
Only use normalize_param_env
when normalizing predicate in check_item_bounds
#117542
Only use normalize_param_env
when normalizing predicate in check_item_bounds
#117542
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…cate, r=<try> Only use `normalize_param_env` when normalizing predicate in `check_item_bounds` r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (950874d): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 637.051s -> 637.852s (0.13%) |
66a1d57
to
3560271
Compare
r? lcnr |
This comment has been minimized.
This comment has been minimized.
3560271
to
cd37539
Compare
@@ -2217,8 +2217,11 @@ pub(super) fn check_type_bounds<'tcx>( | |||
.collect(); | |||
debug!("check_type_bounds: item_bounds={:?}", obligations); | |||
|
|||
// Normalize predicates with the assumption |
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.
can you add a fixme that we should use this param_env everywhere, but can't due to perf, referencing this PR? At least that's my understanding here?
r=me afterwards
Only instantiate binder during dyn's built-in trait candidate probe once See UI test for demonstration of the issue. This was "caused" by rust-lang#117131, but only because we're using the `normalize_param_env` (which has been augmented with a projection clause used to normalize GATs) which features non-lifetime bound vars in it. Fixes rust-lang#117602 technically, though that's also fixed by rust-lang#117542. r? types
cd37539
to
97c9d8f
Compare
@bors r=lcnr |
☀️ Test successful - checks-actions |
Finished benchmarking commit (fab1054): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
Binary sizeResultsThis 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.
Bootstrap: 664.216s -> 664.739s (0.08%) |
Amazing improvements for @rustbot label: +perf-regression-triaged |
(Note: the wins are fixing #117131 (comment)) |
Yeah sorry y'all, this PR simplify fixes a regression both in behavior and perf. |
Fixes private-attribution#837 because the underlying issue rust-lang/rust#117542 is fixed
Fixes #837 because the underlying issue rust-lang/rust#117542 is fixed
Only use the
normalize_param_env
when normalizing the item bound predicate incheck_item_bounds
, instead of using it when processing this obligation as well. This causes #117606 to reoccur, but hopefully with better caching in the future, we can fix this without having such bad effects on perf.This PR also fixes #117598. It turns out that the GAT predicate that we install is actually wrong -- given code like:
We currently generate a predicate that looks like
<Any as HasValueRef<'r>>::Database = Any
, where'r
is an early-bound variable. Really this GAT assumption should be universally quantified over the impl's args, i.e.for<'r> <Any as HasValueRef<'r>>::Database = Any
, but then we'd need the binder to also include all the WC of the impl as well, which we don't support yet, lol.