Why this fires¶
An implementation omits a required associated type, defines it more than once, names an associated type the trait does not declare, or supplies a type that fails the associated type's bounds.
trait Source {
type Item
fn next(self) -> Self::Item
}
struct Values {}
impl Source for Values {
// ^^^^^^ error[TE305]: missing associated type `Item`
fn next(self) -> int { 0 }
}Fix it¶
Define every associated type without a default exactly once, using the spelling from the trait. The selected concrete type must implement all declared associated bounds.
impl Source for Values {
type Item = int
fn next(self) -> int { 0 }
}