Skip to content

Meta tracking issue for impl Trait #63066

Open

Description

@Centril

This issue tracks the progress of impl Trait in general.

This issue is not for discussion about specific extensions to impl Trait and only exists to provide links to other places that track the progress of specific issues. If you wish to discuss some subject related to impl Trait, please find an existing appropriate issue below or create an new issue and comment here with a link to the newly created issue.


The impl Trait related issues currently on deck are as follows:


Open RFCs:

None.

Activity

  1. added
    metabugIssues about issues themselves ("bugs about bugs")
    T-langRelevant to the language team
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Jul 28, 2019
  2. kevincox commented on Oct 16, 2019

    @kevincox
    Contributor

    #65481 Allow impl Trait in trait method return values.

  3. sighoya commented on Nov 17, 2019

    @sighoya
  4. Aaron1011 commented on Nov 17, 2019

    @Aaron1011
  5. CryZe commented on Nov 17, 2019

    @CryZe
  6. sighoya commented on Nov 17, 2019

    @sighoya
  7. mark-i-m commented on Nov 17, 2019

    @mark-i-m
  8. CryZe commented on Nov 17, 2019

    @CryZe
  9. Centril commented on Nov 17, 2019

    @Centril
    ContributorAuthor

    @sighoya @Aaron1011 @mark-i-m @CryZe This issue is not for general discussion about impl Trait. It's only intended to collect links.

    This issue is not for discussion about specific extensions to impl Trait and only exists to provide links to other places that track the progress of specific issues. If you wish to discuss some subject related to impl Trait, please find an existing appropriate issue below or create an new issue and comment here with a link to the newly created issue.

  10. 1 remaining item

  11. Nemo157 commented on Jun 25, 2020

    @Nemo157
    Contributor

    Trait definitions is your second example, covered by #29661. Your first example is trait implementations, which is covered by RFC 2515 (#63063), specifically the last example of RFC 2515 § Guide-level explanation § Type alias, and it currently works on nightly with #![feature(type_alias_impl_trait)].

  12. rphmeier commented on Jun 25, 2020

    @rphmeier
    Contributor

    Thanks @Nemo157. I would find amendment to the issue text here to make clear that the link to #63063 also encompasses trait implementations and that the sub-link to #29661 is only about associated type defaults helpful. At the moment, the implication of the text is that #63063 is only about "bare" type aliases and #29661 is about impl Trait in associated types.

  13. devxpy commented on Sep 6, 2020

    @devxpy

    Hello, does this include allowing impl Trait in structs? (something RFC2071 may have solved)

    E.g. -

    struct Session {
        client: websocket::sync::Client<impl websocket::sync::Stream>
    }
    error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
       --> src/main.rs:139:37
        |
    139 |     client: websocket::sync::Client<impl websocket::sync::Stream>,
        |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    

    The current workaround for doing this is quite unergonomic -

    use anyhow::Result;
    use websocket;
    
    fn main() -> Result<()> {
        let session = create_session()?;
        Ok(())
    }
    
    struct Session<T: websocket::sync::Stream> {
        client: websocket::sync::Client<T>,
    }
    
    fn create_session() -> Result<Session<impl websocket::sync::Stream>> {
        let client = websocket::ClientBuilder::new("ws://...")?.connect_insecure()?;
        Ok(Session { client })
    } 

    Source

    vs if this was implemented -

    use anyhow::Result;
    use websocket;
    
    fn main() -> Result<()> {
        let session = Session::new()?;
        Ok(())
    }
    
    struct Session {
        client: websocket::sync::Client<impl websocket::sync::Stream>
    }
    
    impl Session {
    	fn new() -> Result<Self> {
    	    let client = websocket::ClientBuilder::new("ws://...")?.connect_insecure()?;
    	    Ok(Session { client })
    	}
    }
  14. ibraheemdev commented on Jan 3, 2021

    @ibraheemdev
    Member

    Is there a tracking issue for named existential types? The original tracking issue (#44685) was closed as a duplicate of #34511, which was closed in favor of this issue, but I don't see named existential types mentioned anywhere here...

  15. memoryruins commented on Jan 3, 2021

    @memoryruins
    Contributor

    Is there a tracking issue for named existential types?

    @ibraheemdev #63063
    https://rust-lang.github.io/rfcs/2515-type_alias_impl_trait.html

  16. added
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    on Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-impl-incompleteStatus: The implementation is incomplete.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.metabugIssues about issues themselves ("bugs about bugs")

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions