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

Map RPIT duplicated lifetimes back to fn captured lifetimes #114602

Merged
merged 5 commits into from
Aug 8, 2023

Conversation

compiler-errors
Copy link
Member

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

Use the lifetime_mapping to map an RPIT's captured lifetimes back to the early- or late-bound lifetimes from its parent function. We may be going thru several layers of mapping, since opaques can be nested, so we introduce TyCtxt::map_rpit_lifetime_to_fn_lifetime to loop through several opaques worth of mapping, and handle turning it into a ty::Region as well.

We can then use this instead of the identity substs for RPITs in check_opaque_meets_bounds to address #114285.

We can then also use map_rpit_lifetime_to_fn_lifetime to properly install bidirectional-outlives predicates for both RPITs and RPITITs. This addresses #114601.

I based this on #114574, but I don't actually know how much of that PR we still need, so some code may be redundant now... 🤷


Fixes #114597
Fixes #114579
Fixes #114285

Also fixes #114601, since it turns out we had other bugs with RPITITs and their duplicated lifetime params 😅.

Supersedes #114574

r? @oli-obk

@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 8, 2023
@compiler-errors
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

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

bors commented Aug 8, 2023

⌛ Trying commit bc461799fc9e220b2024d76858cf84251b73af70 with merge 82ab41b39edc01008508d4b458cc34ede29be16b...

@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch from bc46179 to 688c743 Compare August 8, 2023 00:15
@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Aug 8, 2023

⌛ Trying commit 688c743ff88e9db224a16751dc5a1da4c949c6c6 with merge f66ef3d2de1894e1454094853abcdeb83cd3e06d...

@bors
Copy link
Contributor

bors commented Aug 8, 2023

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

@rust-timer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch from 688c743 to 7fb0aa7 Compare August 8, 2023 03:21
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch 3 times, most recently from 9f4789d to c05615e Compare August 8, 2023 04:20
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch from c05615e to 0614554 Compare August 8, 2023 04:28
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f66ef3d2de1894e1454094853abcdeb83cd3e06d): 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)
- - 0
Regressions ❌
(secondary)
3.8% [3.8%, 3.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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)
- - 0
Improvements ✅
(primary)
-3.5% [-3.5%, -3.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.5% [-3.5%, -3.5%] 1

Binary size

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

Bootstrap: 652.752s -> 650.391s (-0.36%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 8, 2023
@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch from 0614554 to 3942d2a Compare August 8, 2023 09:39
@rust-cloud-vms rust-cloud-vms bot force-pushed the rpit-outlives-sadness branch from 3942d2a to 0adf704 Compare August 8, 2023 09:40
@oli-obk
Copy link
Contributor

oli-obk commented Aug 8, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Aug 8, 2023

📌 Commit 0adf704 has been approved by oli-obk

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

bors commented Aug 8, 2023

⌛ Testing commit 0adf704 with merge bf62436...

@bors
Copy link
Contributor

bors commented Aug 8, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing bf62436 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Aug 8, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing bf62436 to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Aug 8, 2023
@bors bors merged commit bf62436 into rust-lang:master Aug 8, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 8, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf62436): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.8% [-1.1%, -0.6%] 2
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

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)
1.8% [0.8%, 2.4%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.9% [-1.9%, -1.9%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 633.541s -> 631.076s (-0.39%)

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
6 participants