-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Closed
Copy link
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait system
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.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait system