-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-inferenceArea: Type inferenceArea: Type inferenceA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-member-constraints`#[feature(member_constraints)]``#[feature(member_constraints)]`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCT-langRelevant to the language teamRelevant to the language team
Description
Member constraints
#61775 introduced "member constraints" as part of stabilizing async functions. These extend region inference to accommodate impl Trait
return types that contain multiple unrelated lifetimes (e.g., impl Trait<'a, 'b>
where neither 'a: 'b
nor 'b: 'a
). We decided to introduce a feature gate for other cases until we have time to gain more experience.
Learn more
The working of these constraints is described in the rustc-guide -- as of this writing, however, the PR has not yet landed.
Current status
- Implemented (generalize impl trait to permit multiple lifetime bounds #61775)
- Described in rustc-guide (Region inference member constraints rustc-dev-guide#344)
- Stabilized
Related issues
- Impl trait (Tracking issue for
impl Trait
(RFC 1522, RFC 1951, RFC 2071) #34511) - Uncertain interaction with impl trait in bindings (
impl_trait_in_bindings
and pick-constraint region bounds #61773)
schneiderfelipestanislav-tkach and schneiderfelipe
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-inferenceArea: Type inferenceArea: Type inferenceA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-member-constraints`#[feature(member_constraints)]``#[feature(member_constraints)]`B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCT-langRelevant to the language teamRelevant to the language team