New issue
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
error[E0119]: conflicting implementations of trait bitflags::<unnamed>::convert::From<&_>
for type types::to_sql::ToSqlOutput<'_>
#313
Comments
This also affects |
This will be fixed by rust-lang/rust#46329. Note, however, that it appears that these two implementations will eventually result in an error. |
I update rust
this issuse is fixed. |
This is a soundness issue that will eventually become a hard error. How hard would it be for you to avoid this pattern? |
I'm not sure? Sorry, having a hard time understanding what the issue is exactly. I can remove one of the impls without affecting this crate, but don't know if that would break something downstream. |
The problem is that anyone could implement a type satisfying The coherence rules do not allow you to leave a "coherence minefield" for descendant crates, where them implementing traits that you do not own for types that you do not own will cause their dependencies' impls to explode, so your impls can't be allowed. Because of a bug in rustc, your impls were allowed, so a downstream crate could cause an impl overlap and associated badness. I'm not sure what is the best way to fix this - I'm just telling you that your code can cause soundness problems downstream. |
Ah, thanks for the explanation. I misspoke earlier - I cannot remove one of the impls without making other changes. Is the right way to fix this to remove one of the impls and add explicit impls for concrete types for the other one, a la aa64e2f? |
Anything that will avoid errors with the most recent nightly is OK. |
The fix in aa64e2f looks correct and reasonable to me. |
Error message
The text was updated successfully, but these errors were encountered: