Trait method resolution is overly eager for nested pointers & types #11820
Labels
A-trait-system
Area: Trait system
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
&T
has an impl ofClone
for allT
(i.e.(&T).clone()
should always work), however having&TypeThatConditionallyImplementsClone<T>
is not always clonable, because (it appears that) the compiler will lock itself into using theClone
impl for the inner type, but find thatT
doesn't satisfy the requirements and so error.Without
--cfg error
it compiles fine, but with it:The text was updated successfully, but these errors were encountered: