Bug when implementing From on an associated type defined in an external crate #138816
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-coherence
Area: Coherence
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
There seems to be a bug with implementing the
From
trait when the type argument is an associated type defined in an external crate.To reproduce this bug you need to have 2 crates.
the first crate, let's call it
aaa
, is a library crate and contains the following code in itssrc/lib.rs
file:the second crate, let's call it
bbb
, is also a library crate. it depends on theaaa
crate, and it contains the following code in itssrc/lib.rs
file:I expected both crates to compile properly.
Instead, i get the following error when trying to compile crate
bbb
:For some reason, the compiler thinks that my implementation conflicts with the blanket implementation, as if it thinks that
<aaa::DummyStruct as aaa::DummyTrait>::DummyAssociatedType
is somehow the same type asDummyStructInCrateB
, which is obviously wrong.Meta
rustc --version --verbose
:the bug also reproduces on the following nightly version:
The text was updated successfully, but these errors were encountered: