2 Checks for format trait implementations (e.g. `Display`) with a recursive call to itself
3 which uses `self` as a parameter.
4 This is typically done indirectly with the `write!` macro or with `to_string()`.
7 This will lead to infinite recursion and a stack overflow.
14 struct Structure(i32);
15 impl fmt::Display for Structure {
16 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
17 write!(f, "{}", self.to_string())
26 struct Structure(i32);
27 impl fmt::Display for Structure {
28 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
29 write!(f, "{}", self.0)