Should warn when calling blanket implementation of a method rather than our own #61930
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.
The following snippet crashes:
fmt()
calls the blanket implementation ofToString
, which is usingDisplay
, instead of our own implementation resulting in an infinite recursion.We wouldn't have the problem if our function was taking
&self
but that's still pretty confusing and prone to errors. It would be good to have at least a warning (or a clippy lint?) for such patterns.The text was updated successfully, but these errors were encountered: