Error code E0719
An associated item was specified more than once in a trait object.
Erroneous code example:
#![allow(unused)]
fn main() {
trait FooTrait {}
trait BarTrait {}
// error: associated type `Item` in trait `Iterator` is specified twice
type Foo = dyn Iterator<Item = u32, Item = u32>;
}
To fix this, remove the duplicate specifier:
Corrected example:
#![allow(unused)]
fn main() {
type Foo = dyn Iterator<Item = u32>; // ok!
}
For more information about associated types, see the book. For more information on associated type bounds, see RFC 2289.