incompatible types when using re-exports of the same crate from different crates (different paths) #105277
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-bug
Category: This is a bug.
D-crate-version-mismatch
Diagnostics: Errors or lints caused be the use of two different crate versions.
S-needs-repro
Status: This issue has no reproduction and needs a reproduction to make progress.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: No error
Instead, this happened:
sickle_query::types::time
andtiberius::time
are re-exports of thetime
crate. For multiple reasons, these may be different versions with different features and are not be assumed to be the same. However, it seems that rustc is detecting that they are the same crate, and then "forgets" the path or assumes the wrong path on line 53. But though the path is explicitly given on both the left and right hand sides of the assignment, so there is no ambiguity.Confirmed this for nightly with
cargo +nightly build --workspace --all-targets --all-features
Note: This seems different than #102882, because I am explicitly stating the paths of which re-export to use, and am not making assumptions that they are the same. rustc seems to arbitrarily pick/unify/dedup a different re-export than what is explicitly stated on one side of the assignment, then fails to do the same with the other side.
Meta
rustc --version --verbose
:Backtrace
No backtrace; it doesn't build.
The text was updated successfully, but these errors were encountered: