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 all lifetimes for TAITs and impl trait in associated types #114616

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Aug 8, 2023

This reverts commit cb94675, reversing changes made to 57781b2. (This is only true for the tests, the change itself was done from scratch, as the compiler has diverged sufficiently for a revert to not make sense anymore).

This implements the lang team decision from this meeting: https://hackmd.io/sFaSIMJOQcuwCdnUvCxtuQ?view

r? @cjgillot on the impl

@rustbot
Copy link
Collaborator

rustbot commented Aug 8, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me on impl

@compiler-errors
Copy link
Member

Also, it may be useful to cherry-pick ba07937b29b0381a4aa8307c9b45d98d5348ca02 (deleting the RPITIT-specific test) and add some variance tests for TAITs.

something like:

#![rustc_variance_of_opaques]

type Foo<'a, 'b: 'b, T> = impl Sized; //~ ERROR [o, o, o]

@cjgillot cjgillot assigned compiler-errors and unassigned cjgillot Aug 20, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 28, 2023
…r=oli-obk

Make RPITITs capture all in-scope lifetimes

Much like rust-lang#114616, this implements the lang team decision from this T-lang meeting on [opaque captures strategy moving forward](https://hackmd.io/sFaSIMJOQcuwCdnUvCxtuQ?view). This will be RFC'd soon, but given that RPITITs are a nightly feature, this shouldn't necessarily be blocked on that.

We unconditionally capture all lifetimes in RPITITs -- impl is not as simple as rust-lang#114616, since we still need to duplicate RPIT lifetimes to make sure we reify any late-bound lifetimes in scope.

Closes rust-lang#112194
@compiler-errors compiler-errors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 30, 2023
@oli-obk oli-obk force-pushed the gotta_capture_'em_all branch from 81c1cc7 to e82ccd5 Compare August 30, 2023 11:24
@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 30, 2023

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Aug 30, 2023

📌 Commit e82ccd5 has been approved by compiler-errors

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 30, 2023
@bors
Copy link
Contributor

bors commented Aug 30, 2023

⌛ Testing commit e82ccd5 with merge ac02e40...

@bors
Copy link
Contributor

bors commented Aug 30, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing ac02e40 to master...

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

Finished benchmarking commit (ac02e40): 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)
2.3% [1.4%, 3.0%] 3
Regressions ❌
(secondary)
2.0% [1.3%, 3.1%] 5
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [-1.4%, 3.0%] 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)
3.9% [3.2%, 4.4%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 631.943s -> 632.335s (0.06%)
Artifact size: 316.62 MiB -> 316.60 MiB (-0.01%)

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.

6 participants