We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was trying to do something like this:
use std::io; enum Foo<T> { Bar(T), Qux, } impl<T: PartialEq> PartialEq for Foo<T> { fn eq(&self, other: &Self) -> bool { match (self, other) { (&Foo::Bar(ref a), &Foo::Bar(ref b)) => a == b, (&Foo::Qux, &Foo::Qux) => true, (_, _) => false, } } } impl PartialEq for Foo<io::Error> { fn eq(&self, other: &Self) -> bool { unimplemented!() } }
And got the following error as a result:
error: conflicting implementations of trait `std::cmp::PartialEq` for type `Foo<std::io::Error>`: [--explain E0119] --> <anon>:18:1 |> 18 |> impl PartialEq for Foo<io::Error> { |> ^ note: conflicting implementation is here: --> <anon>:8:1 |> 8 |> impl<T: PartialEq> PartialEq for Foo<T> { |> ^ error: aborting due to previous error
In and of itself, there is no straightforward explanation as to why this is happening, since io::Error doesn't implement PartialEq.
The text was updated successfully, but these errors were encountered:
I ran into this and it took me a while to figure out what is wrong with my code:
trait A {} trait B {} trait Foo<T> { } impl<T, U> Foo<T> for U: A { ... } impl<T, U> Foo<T> for U: B { ... }
The only information that the error gives is that there are two conflicting implementations.
I would have understood the problem faster if the error message would tell me why are these two implementations conflicting.
Sorry, something went wrong.
Seems to be a duplicate of #23980.
Closing as a duplicate of #23980. (Thanks @qnighy!)
No branches or pull requests
I was trying to do something like this:
And got the following error as a result:
In and of itself, there is no straightforward explanation as to why this is happening, since io::Error doesn't implement PartialEq.
The text was updated successfully, but these errors were encountered: