Repository navigation
Projections, lifetimes, and WF tracking issue (RFC 1214) #27579
Copy link
Copy link
Closed
Labels
A-type-systemArea: Type systemArea: Type systemB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Description
Tracking issue for rust-lang/rfcs#1214
- ICE: Encountered error
Unimplemented... (trait objects & associated type bounds) #26406 -
Mismatched assumptions for interaction between associated type and lifetime in trait #24622 -
associated type does not live long enough #23442 -
&[Trait] should probably not be allowed #21748 -
[[T]] is allowed in structs #25692 -
declaration of non-object-safe trait object type should be invalid #21953 -
format_args! returned from a closure causes corruption/crash #27592 - Just take implied bounds from arguments. Implementing this probably requires improving
check_method -
Apparent regression in implied bounds #27583 - Clarify WF checking for negative impls
- WF checking for object fragments where
Selfis not needed - static methods should be able to assume that
Selfis WF, I believe (at least in trait impls) - WF for trait objects should include the trait bounds
- object-safe traits can have associated types with unchecked bounds #27675: object-safe traits can have associated types with unchecked bounds (unsoundness bug)
After warning cycle is complete
- Remove old WF check
- Remove RFC1214 origins and warnings
- Remove special treatment of
ReEmptyin the outlives relation
Testing chart
| Subject | Tests | Issues |
|---|---|---|
| OutlivesScalar | regions-outlives-scalar.rs | |
| OutlivesNominalType | regions-outlives-nominal-type-struct.rs | |
| regions-outlives-nominal-type-enum.rs | ||
| OutlivesReference | all of the other tests | |
| OutlivesObject | compile-fail/wf-in-obj-type-static.rs | |
| OutlivesProjectionEnv | compile-fail/wf-in-obj-type-static.rs | |
| WfObject, lifetime bounds | compile-fail/regions-wf-trait-object.rs | |
| WfSlice | compile-file/wf-array-elem-sized.rs | |
| const | wf-const-type.rs | |
| struct, bound | wf-struct-bound.rs | |
| struct, field | ...many other tests... | |
| enum, bound | wf-enum-bound.rs | |
| enum, field | ...many other tests... | |
| trait, bound | wf-trait-bound.rs | |
| trait, assoc type default | wf-trait-associated-type-trait.rs | |
| wf-trait-associated-type-region.rs | ||
| trait, assoc type bound | wf-trait-associated-type-bound.rs | |
| trait, default fn, arg | wf-trait-default-fn-arg.rs | |
| trait, default fn, return | wf-trait-default-fn-ret.rs | |
| trait, default fn, where clause | wf-trait-default-fn-where-clause.rs | |
| trait, fn, arg | wf-trait-fn-arg.rs | |
| trait, fn, return | wf-trait-fn-ret.rs | |
| trait, fn, where clause | wf-trait-fn-where-clause.rs | |
| fn item, argument type | wf-in-fn-arg.rs | |
| fn item, return type | wf-in-fn-ret.rs | |
| fn item, where clause | wf-in-fn-where-clause.rs | |
| inherent impl, where clause | wf-inherent-impl-where-clause.rs | |
| inherent impl, fn, where clause | wf-inherent-impl-method-where-clause.rs | |
| impl, assoc type default | wf-impl-associated-type-region.rs | |
| wf-impl-associated-type-trait.rs | ||
| fn type, argument type | wf-in-fn-type-arg.rs | |
| fn type, return type | wf-in-fn-type-ret.rs | |
| wf-in-fn-type-static.rs | ||
| object type arg | compile-fail/wf-in-obj-type-static.rs | |
| compile-fail/wf-in-obj-type-region.rs | ||
| object safety | compile-fail/wf-object-safe.rs | #21953 |
fn(T): 'a affects T |
compile-fail/wf-outlives-ty-in-fn-or-trait.rs | |
| OutlivesProjection* | compile-fail/associated-types-outlives.rs | #24622 |
| OutlivesProjection* | compile-fail/regions-assoc-type-outlives-container*.rs | |
| OutlivesProjectionComponents | compile-fail/regions-close-associated-type-into-object.rs | |
| implied bounds projection gap | compile-fail/regions-implied-bounds-projection-gap*rs |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Activity
jroesch commentedon Aug 9, 2015
cc me
Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc
frewsxcv commentedon Sep 5, 2015
#27592 and #27583 can be checked-off in the original description
also, is there a way to determine which crates are impacted by the changes proposed by RFC 1214?
mitchmindtree commentedon Sep 10, 2015
Just wanted to mention that I'm really excited for these changes to land on stable 😸 I have a lot of
whereclauses that look something like this: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
instead.
Stebalien commentedon Sep 30, 2015
Also fixes #21837.
nikomatsakis commentedon Sep 30, 2015
@Stebalien
Not quite, because the interaction of implied bounds with variance is still not being properly handled.
Stebalien commentedon Sep 30, 2015
@nikomatsakis sorry, it fixes the current test case so I assumed it fixed the bug.
mitchmindtree commentedon Dec 23, 2015
I'd love to know the status of this 😸
BTW, It looks like we may be able to check off some of the related issues in the original comment: #24622, #23442, #21748, #25692, #21953 and as @frewsxcv mentioned, #27592 and #27583.
brson commentedon Jun 23, 2016
@nikomatsakis Is this still P-high? Can it be lowered or assigned?
pnkfelix commentedon Jun 23, 2016
assigning to self to double-check what's done and what's not
3 remaining items
Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc
pnkfelix commentedon Feb 21, 2019
unassigning self; i haven't done anything with this and I don't think I'm the right person to take charge here.
pnkfelix commentedon Mar 4, 2022
Discussed at today's T-compiler backlog bonanza.
@rustbot label +T-lang +WG-traits +S-tracking-needs-summary
nikomatsakis commentedon Jun 17, 2022
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.
Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrc