-
Notifications
You must be signed in to change notification settings - Fork 187
Closed
Description
I tried this code:
trait A<T> {
type Output;
fn test(self, a: &T) -> &Self::Output;
}
struct Foo<T>{
start: T,
end: T,
}
impl<T> A<T> for Foo<usize> {
type Output = T;
fn test(self, a: &T) -> &Self::Output {
a
}
}
I expected to see this happen: compile without error
Instead, this happened:
<source>:12:6: error: unconstrained type parameter
12 | impl<T> A<T> for Foo<usize> {
| ^
see: https://godbolt.org/z/aK4T4xEGq
Meta
- What version of Rust GCC were you using, git sha if possible. b82408f