-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Eagerly drop higher-ranked type outlives obligations if satisfied by param env #98034
Eagerly drop higher-ranked type outlives obligations if satisfied by param env #98034
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 47a32b9 with merge 49b46b6d0cc3b0f4ec5c5103ab51ee37cbdbd052... |
☀️ Try build successful - checks-actions |
Queued 49b46b6d0cc3b0f4ec5c5103ab51ee37cbdbd052 with parent 546c826, future comparison URL. |
Finished benchmarking commit (49b46b6d0cc3b0f4ec5c5103ab51ee37cbdbd052): comparison url. Instruction count
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 Footnotes |
as expected... i wonder if we can employ some of the same heuristics used in impl matching. |
I think I'd like that as the fix that we backport, as it's trivially correct and hopefully not a perf regression. |
Oh, yes, I totally forgot that @oli-obk mentioned we wanted to backport a fix, lol, or at least ensure a fix gets into the next beta. I can write up that solution easily. |
Wait hold up. we already backported the revert, so there is no problem on beta. sorry for the false alarm! |
We should still probably do that change to get it merged on nightly before the beta cutoff, out of the reasons I mentioned for the wrongly-assumed-beta-backport |
Attempts to satisfy
TypeOutlives
predicates using the param env, instead of unconditionally registering them in the infcx for later borrowck'ing. The first commit e176496 is the simpler attempt to fix this problem --and it fixes #97607 -- but only does so forTypeOutlives(_, RePlaceholder)
, so #86483 continues to fail.The second commit 47a32b9 makes this logic slightly more complicated, but allows us to use
for<'a> T: 'a
to satisfyfor<'a> T: 'region
in general (including'region = 'static
), as long as it doesn't cause us to further constrain any region variables inT
.I'm still unsure if this is the right approach -- this is a generalization of the logic I think @oli-obk suggested here. Maybe it's overkill, and we can just search for exact matches in the param-env instead. I'd appreciate feedback.
I don't know who to r?, so I guess I'll just
r? @nikomatsakis
cc @rust-lang/types
Fixes #97607
Also converts tests from #88586, #86483 into passing.