W3cubDocs

/Rust

Error code E0643

This error indicates that there is a mismatch between generic parameters and impl Trait parameters in a trait declaration versus its impl.

#![allow(unused)]
fn main() {
trait Foo {
    fn foo(&self, _: &impl Iterator);
}
impl Foo for () {
    fn foo<U: Iterator>(&self, _: &U) { } // error method `foo` has incompatible
                                          // signature for trait
}
}

© 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/E0643.html