-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make RPITITs inherit the assumed_wf_types
of their parent method
#113704
Make RPITITs inherit the assumed_wf_types
of their parent method
#113704
Conversation
e1cc94d
to
df5ac0d
Compare
☔ The latest upstream changes (presumably #113801) made this pull request unmergeable. Please resolve the merge conflicts. |
df5ac0d
to
7bf6b45
Compare
This comment has been minimized.
This comment has been minimized.
7bf6b45
to
44fff87
Compare
r? @spastorino |
This comment has been minimized.
This comment has been minimized.
b43e2c9
to
32875db
Compare
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.
This is great Michael, thanks for doing this.
r=me after checking my nits and doing what you prefer with them.
32875db
to
eb85ca9
Compare
@bors r+ |
📌 Commit eb85ca976166c66c6ee1e9238b1a8b21b24332f6 has been approved by It is now in the queue for this repository. |
⌛ Testing commit eb85ca976166c66c6ee1e9238b1a8b21b24332f6 with merge 9e7cc5cc95a272c11378af6cded2dcb7b5c2dee3... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
eb85ca9
to
744e770
Compare
had to bless a test @bors r=spastorino |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b969b83): comparison URL. Overall result: ❌ regressions - no action needed@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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 652.626s -> 650.727s (-0.29%) |
... and then move the RPITIT well-formedness check to just use the regular logic of wfchecking an associated type.
We need to inherit the
assumed_wf_types
of the RPITIT's parent function in order for the given code to be considered well-formed:Since for
&'a T
to be WF, we needT: 'a
.In order for this to work for late-bound lifetimes, we need to do some additional mapping of any late-bound lifetimes captured by these assumed wf types. This is because within the body of the function (and thus in the
assumed_wf_types
), they're represented asReFree
variants of the original late-bound lifetimes declared in the function's generics, but in the RPITIT's GAT, they're represented as "reified"ReEarlyBound
vars (duplicated during opaque type lowering). Luckily, the mapping between these two is already stored in the opaque.Fixes #113796