W3cubDocs

/Rust

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.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0719.html