Undetected unconditional recursion in Clone impl using to_owned() #40437
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Rustc gives no warning, but this overflows the stack.
Slightly more realistic example:
(Real life use case for implementing
Clone
throughderef -> to_owned
)Is it feasible for rustc to detect this kind of cross-trait unconditional recursion?
The text was updated successfully, but these errors were encountered: