mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 03:23:33 +00:00
28 lines
927 B
Text
28 lines
927 B
Text
error: implementation of inherent method `to_string(&self) -> String` for type `A`
|
|
--> $DIR/inherent_to_string.rs:18:5
|
|
|
|
|
LL | / fn to_string(&self) -> String {
|
|
LL | | "A.to_string()".to_string()
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: `-D clippy::inherent-to-string` implied by `-D warnings`
|
|
= help: implement trait `Display` for type `A` instead
|
|
|
|
error: type `C` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`
|
|
--> $DIR/inherent_to_string.rs:42:5
|
|
|
|
|
LL | / fn to_string(&self) -> String {
|
|
LL | | "C.to_string()".to_string()
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/inherent_to_string.rs:2:9
|
|
|
|
|
LL | #![deny(clippy::inherent_to_string_shadow_display)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: remove the inherent method from type `C`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|