-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Description
Minimal reproduction (playground link, hit 'format' then try building to see it in action):
Before
trait Foo {
type Arg<'a>;
}
struct Bar<T>(T) where for<'a> T: Foo<Arg<'a> = ()>;
After
trait Foo {
type Arg<'a>;
}
struct Bar<T>(T)
where
for<'a> T: Foo<Arg = ()>;
// ^^^ note the lack of <'a> bound, which is needed
This will result in the following compiler error:
error[E0107]: missing generics for associated type `Foo::Arg`
--> src/main.rs:9:20
|
9 | for<'a> T: Foo<Arg = ()>;
| ^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
--> src/main.rs:4:10
|
4 | type Arg<'a>;
| ^^^ --
help: add missing lifetime argument
|
9 | for<'a> T: Foo<Arg<'a> = ()>;
| ~~~~~~~
raftario