Closed
Description
#![feature(generic_associated_types)]
trait Foo {
type Assoc<'a, const N: usize>;
}
fn foo<T: Foo>() {
let _: <T as Foo>::Assoc<3>;
}
results in the following error:
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> src/lib.rs:7:24
|
7 | let _: <T as Foo>::Assoc<3>;
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> src/lib.rs:3:10
|
3 | type Assoc<'a, const N: usize>;
| ^^^^^ --
help: add missing lifetime argument
|
7 | let _: <T as Foo>::Assoc<'a3>;
| ^^
Note that we suggest <T as Foo>::Assoc<'a3>
here, which is missing a comma.
Metadata
Metadata
Assignees
Labels
Area: Generic associated types (GATs)Area: Associated items (types, constants & functions)Area: const generics (parameters and arguments)Category: This is a bug.Diagnostics: A structured suggestion resulting in incorrect code.`#![feature(generic_associated_types)]` a.k.a. GATsRelevant to the compiler team, which will review and decide on the PR/issue.