-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rustc reports trait implementations as conflicting even if they are not conflicting #100712
Comments
@rustbot claim |
As far as I understand, this is actually intended behaviour, though admittedly confusing. The reason that we can't normalize that projection during the coherence check is, afaict, that we have to be conservative with trait refs that don't obey the orphan rules (which Edit: Actually it doesn't make sense that we should be able to normalize the projection in contexts outside of the coherence check, but fail to do so during the check. Might make sense to have a lint that warns about normalization failures in that context though?! @rustbot release-assignment |
probably a duplicate of #99940 |
@lcnr Yes that seems like a duplicate. Will close that one and subscribe to the other issue. Is it planed to fix that someday or not? I'm asking because I'm currently trying to design a proc marco derive where such impls would be nice to have, otherwise I need to find other ways to implement the required functionality. |
it is planned to fix this sometimes, sadly the fix is somewhat difficult and this is also not too high of a priority, so it may take a while '^^ |
Thanks for the fast answer. I will try to find another solution then 🙈 |
I tried this code:
I expected to see this happen: The code compiles without errors, as all trait implementations are not conflicting (as demonstrated by the impls on
Bar
)Instead, this happened: Compilation fails with the following error message:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: