Why this fires¶
An impl <Trait> for <Type> names a trait that doesn't exist — neither a trait declared in the program nor one of the known standard traits (Iterator, Eq, Ord, Default, ...). Usually a typo.
trait Iterable { fn next(self) -> int }
struct V {}
impl Iterabe for V {
// ^^^^^^^ error[TE302]: unknown trait 'Iterabe' in `impl ... for V`. Did you mean 'Iterable'?
fn next(self) -> int { return 0 }
}Fix it¶
Trust the "did you mean?" suggestion and fix the spelling:
impl Iterable for V {
fn next(self) -> int { return 0 }
}See also¶
TE822— the same "unknown trait" check for a generic parameter's trait bound.TE825— animplis missing one of the trait's required methods.- /docs/data-structures#traits — declaring and implementing traits.