Skip to content

RPITIT with GAT fails to enforce where Self: 'a bound #116789

Closed
@aliemjay

Description

@aliemjay

The following compiles after the stabilization of RPITIT/AFIT in #115822:

trait Trait {
    type Gat<'a>;
    async fn foo(&self) -> Self::Gat<'_>;
}

but it should require adding where Self: 'a bound to Gat similar to the non-async version (see #87479):

trait Trait {
    type Gat<'a>;
    //~^ ERROR missing required bound on `Gat`
    //~| HELP add the required where clause: `where Self: 'a`

    fn foo(&self) -> Self::Gat<'_>;
}

cc @compiler-errors

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions