-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
"Mismatched types" error when comparing the same struct for equality when referenced from two libraries #87534
Comments
Triage: If we build with First b is built like a library, since a depends on it.
Then a is built as a library, referencing the b lib that was just built.
Now a is built as a test, depending on the b lib that is already built. Nothing strange.
Now b is built as a test, depending on the a lib that depends on the b lib that is already built.
so now we have two instances of the b crate. The one being compiled (6107a1a1766b86b2), and the one indirectly referenced by a (f4816aced84dfaf9). The error given nowadays is I think pretty clear. Can you think of a way to make the error message even clearer?
|
Thanks for the explanation. I think #105793 makes this error abundantly clear now. |
I tried this code:
I would expect this code to compile but instead it emits the error "expected struct
b::NonGeneric
, found structNonGeneric
" which is odd as I would think they are the same type.Meta
Reproducible on 1.56.0-nightly.
Repository: https://github.com/andyyu2004/rust-bug-repro
The text was updated successfully, but these errors were encountered: