-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Projections, lifetimes, and WF tracking issue (RFC 1214) #27579
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
cc me |
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, #27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
Just wanted to mention that I'm really excited for these changes to land on stable 😸 I have a lot of where
P::HLI: 'a + 'b,
P::PatternGenerator: 'a + 'b,
P::PhraseGenerator: 'a + 'b,
P::Instrument: 'a + 'b,
<P::Instrument as Instrument>::Source: 'a + 'b,
P::Effect: 'a + 'b,
P::Sample: 'a + 'b,
P::BusId: 'a + 'b, If I understand these WF changes correctly, they will save me hundreds of lines being able to simply write where P: 'a + 'b` instead. |
Also fixes #21837. |
Not quite, because the interaction of implied bounds with variance is still not being properly handled. |
@nikomatsakis sorry, it fixes the current test case so I assumed it fixed the bug. |
@nikomatsakis Is this still P-high? Can it be lowered or assigned? |
assigning to self to double-check what's done and what's not |
I don't know with tracking issues in terms of the P-markings. I treat tracking bugs like this like metabugs, so I'm going to remove the P-high since I don't think we should assign priorities to metabugs. |
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, rust-lang/rust#27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
unassigning self; i haven't done anything with this and I don't think I'm the right person to take charge here. |
Discussed in @rust-lang/types triage today. Decided to close this issue -- RFC 1214 is long-since stabilized, and the work on a-mir-formality will help us deal with ensuring exhaustive testing. |
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, rust-lang/rust#27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
Tracking issue for rust-lang/rfcs#1214
Unimplemented
... (trait objects & associated type bounds) #26406Mismatched assumptions for interaction between associated type and lifetime in trait #24622associated type does not live long enough #23442&[Trait] should probably not be allowed #21748[[T]] is allowed in structs #25692declaration of non-object-safe trait object type should be invalid #21953format_args! returned from a closure causes corruption/crash #27592check_method
Apparent regression in implied bounds #27583Self
is not neededSelf
is WF, I believe (at least in trait impls)After warning cycle is complete
ReEmpty
in the outlives relationTesting chart
fn(T): 'a
affectsT
The text was updated successfully, but these errors were encountered: