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

Capture lifetimes for associated type bounds destined to be lowered to opaques #115366

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Aug 30, 2023

Some associated type bounds get lowered to opaques, but they're not represented in the AST as opaques.

That means that we never collect lifetimes for them (record_lifetime_params_for_impl_trait) which are used currently for RPITITs, which capture all of their in-scope lifetimes1. This means that the nested RPITITs that arise from some type like impl Foo<Type: Bar> (~> impl Foo<Type = impl Bar>) don't capture any lifetimes, leading to ICEs.

This PR makes sure we collect the lifetimes for associated type bounds as well, and make sure that they are set up correctly for opaque type lowering later.

Fixes #115360

Footnotes

  1. Make RPITITs capture all in-scope lifetimes #114489

@rustbot
Copy link
Collaborator

rustbot commented Aug 30, 2023

r? @jackh726

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 30, 2023
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 30, 2023

⌛ Trying commit f1679f7 with merge d270d1d991b419b84f01779b3588279d4ab60272...

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 30, 2023
@bors
Copy link
Contributor

bors commented Aug 30, 2023

☀️ Try build successful - checks-actions
Build commit: d270d1d991b419b84f01779b3588279d4ab60272 (d270d1d991b419b84f01779b3588279d4ab60272)

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 30, 2023

☀️ Try build successful - checks-actions
Build commit: d270d1d991b419b84f01779b3588279d4ab60272 (d270d1d991b419b84f01779b3588279d4ab60272)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d270d1d991b419b84f01779b3588279d4ab60272): comparison URL.

Overall result: no relevant changes - no action needed

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.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -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)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-1.6% [-2.0%, -1.1%] 2
Improvements ✅
(secondary)
-3.3% [-4.1%, -2.5%] 2
All ❌✅ (primary) -0.6% [-2.0%, 1.5%] 3

Cycles

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

Binary size

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

Bootstrap: 631.943s -> 630.735s (-0.19%)
Artifact size: 316.62 MiB -> 316.59 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 31, 2023
@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 31, 2023

📌 Commit f1679f7 has been approved by jackh726

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 31, 2023
@bors
Copy link
Contributor

bors commented Aug 31, 2023

⌛ Testing commit f1679f7 with merge 2f5df8a...

@bors
Copy link
Contributor

bors commented Aug 31, 2023

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing 2f5df8a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 31, 2023
@bors bors merged commit 2f5df8a into rust-lang:master Aug 31, 2023
@rustbot rustbot added this to the 1.74.0 milestone Aug 31, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2f5df8a): 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)
1.6% [1.3%, 2.1%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [-1.6%, 2.1%] 4

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)
- - 0
Improvements ✅
(primary)
-0.5% [-0.5%, -0.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.5% [-0.5%, -0.5%] 1

Binary size

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

Bootstrap: 630.392s -> 630.791s (0.06%)
Artifact size: 316.46 MiB -> 316.37 MiB (-0.03%)

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-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.

ICE: Could not resolve Lifetime
5 participants