trait A {
type T;
}
impl A for () {
type T = i32;
}
fn foo<X>(_x: X::T) where X: A {
}
fn main() {
foo::<()>(42);
}
This fails to compile with:
assoc.rs:9:15: 9:19 error: associated type `T` not found for type parameter `X`
assoc.rs:9 fn foo<X>(_x: X::T) where X: A {
^~~~
error: aborting due to previous error
It passes with tweaking the definition:
fn foo<X: A>(_x: X::T) {
}