Skip to content

ensure that '_ and GATs yields errors #95305

Closed
@nikomatsakis

Description

@nikomatsakis

It's not clear how '_ and GATs should interact. We should add tests that using '_ either in the parameter list of a GAT or in its value is prohibited.

e.g., both of these should error (and currently do)

#![feature(generic_associated_types)]

trait Foo {
    type Item<'a>;
}

fn foo(x: &impl Foo<Item<'_> = u32>) { }
#![feature(generic_associated_types)]

trait Foo {
    type Item<'a>;
}

fn foo(x: &impl for<'a> Foo<Item<'a> = &'_ u32>) { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-GATsArea: Generic associated types (GATs)F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsGATs-blockingIssues using the `generic_associated_types` feature that block stabilizationGATs-triagedIssues using the `generic_associated_types` feature that have been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions