Skip to content

Min TAIT + GAT lifetime issue #86218

Closed

Description

@ivan770

I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=71e56b49edea6de440eed3a417322308

Code that is an equivalent to the one above, but that compiles: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f071b171eda8921c1d4902999417594d

I'm not sure about the exact reason for this to happen, but I can suspect the presence of an additional lifetime in impl block that is causing this bug.

I expected to see this happen: It compiles

Instead, this happened: Lifetime error

Meta

rustc --version --verbose: Latest playground version

Activity

  1. ivan770 commented on Jun 13, 2021

    @ivan770
    ContributorAuthor

    @rustbot label +T-compiler +F-type_alias_impl_trait +F-generic_associated_types +A-lifetimes +requires-nightly

  2. added
    A-lifetimesArea: Lifetimes / regions
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 13, 2021
  3. b-naber commented on Jun 16, 2021

    @b-naber
    Contributor

    @rustbot claim

  4. jackh726 commented on Oct 23, 2021

    @jackh726
    Member

    Updated and minimized example:

    #![feature(generic_associated_types)]
    #![feature(type_alias_impl_trait)]
    
    pub trait Stream {
        type Item;
    }
    
    impl Stream for () {
        type Item = i32;
    }
    
    trait Yay<AdditionalValue> {
        type InnerStream<'s>: Stream<Item = i32> + 's;
        fn foo<'s>() -> Self::InnerStream<'s>;
    }
    
    impl<'a> Yay<&'a ()> for () {
        type InnerStream<'s> = impl Stream<Item = i32> + 's;
        fn foo<'s>() -> Self::InnerStream<'s> { todo!() }
    }
  5. jackh726 commented on Oct 23, 2021

    @jackh726
    Member

    Yeah, so somehow 'a is ending up in the substs for the opaque type impl Stream<Item = i32> + 's, and that isn't able to be proven.

  6. jackh726 commented on Oct 23, 2021

    @jackh726
    Member

    GATs issue triage: not blocking. This requires the type_alias_impl_trait feature and seems to revolve around the substs for them, rather than a GATs issue.

  7. oli-obk commented on Mar 31, 2022

    @oli-obk
    Contributor

    @b-naber this issue has been fixed as a side effect of #95474

  8. moved this from Todo to In Progress in type alias impl trait stabilizationon Sep 9, 2022
  9. added a commit that references this issue on Sep 25, 2022
    f5193a9
  10. Repository owner moved this from In Progress to Done in type alias impl trait stabilizationon Sep 25, 2022
  11. added
    A-GATsArea: Generic associated types (GATs)
    on Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-GATsArea: Generic associated types (GATs)A-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsF-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions