You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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) {
}
The text was updated successfully, but these errors were encountered:
This fails to compile with:
It passes with tweaking the definition:
The text was updated successfully, but these errors were encountered: