Closed
Description
Here's an example (reproducible on Rust 1.9+):
trait FutureInternals {
type Item;
type Error;
fn poll(&mut self);
}
trait Future<T, E> where Self: FutureInternals<Item=T, Error=E> {
fn boxed(self) -> Box<Future<T, E>> {
Box::new(self)
}
}
impl<T: FutureInternals> Future<T::Item, T::Error> for T {}
This code produces the error:
error: the value of the associated type `Error` (from the trait `FutureInternals`) must be specified [--explain E0191]
--> <anon>:9:27
|>
9 |> fn boxed(self) -> Box<Future<T, E>> {
|> ^^^^^^^^^^^^
error: the value of the associated type `Item` (from the trait `FutureInternals`) must be specified [--explain E0191]
--> <anon>:9:27
|>
9 |> fn boxed(self) -> Box<Future<T, E>> {
|> ^^^^^^^^^^^^
despite the fact that the associated types are fully constrained.