Can't use #[deriving(Clone)]
on struct with Clone
bounds
#19361
Labels
A-syntaxext
Area: Syntax extensions
#[deriving(Clone)]
on struct with Clone
bounds
#19361
STR
Output
If you look at the
--pretty=expanded
version, you'll seeT
is bounded twice by theClone
traitVersion
The obvious fix seems to make the
deriving
syntax extension filter out the duplicatedClone
just by looking at the trait name. The problem is that::std::clone::Clone
may not be the same trait asClone
, but AFAIK the syntax extension can't know that, since that (path) information is collected after macro expansion.Work-around
One workaround to this issue is using the fact that the
deriving
syntax extension doesn't look atwhere
bounds (see #19358), the following code compiles:The text was updated successfully, but these errors were encountered: