Skip to content

Generic associated types can shadow lifetimes #67512

Closed
@matthewjasper

Description

@matthewjasper

The following code is incorrectly permitted

#![feature(generic_associated_types)]

trait X<'a> {
    type Y<'a>;           //~ Should error
}

impl<'a> X<'a> for () {
    type Y<'a> = &'a ();  //~ Should error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-GATsArea: Generic associated types (GATs)C-bugCategory: This is a bug.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions