2019-07-15 16:43:47 +00:00
|
|
|
error: implementation of inherent method `to_string(&self) -> String` for type `A`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/inherent_to_string.rs:22:5
|
2019-07-06 18:13:38 +00:00
|
|
|
|
|
|
|
|
LL | / fn to_string(&self) -> String {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-07-06 18:13:38 +00:00
|
|
|
LL | | "A.to_string()".to_string()
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2019-07-15 16:43:47 +00:00
|
|
|
= help: implement trait `Display` for type `A` instead
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::inherent-to-string` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::inherent_to_string)]`
|
2019-07-06 18:13:38 +00:00
|
|
|
|
2019-07-15 16:43:47 +00:00
|
|
|
error: type `C` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/inherent_to_string.rs:47:5
|
2019-07-06 18:13:38 +00:00
|
|
|
|
|
|
|
|
LL | / fn to_string(&self) -> String {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2019-07-06 18:13:38 +00:00
|
|
|
LL | | "C.to_string()".to_string()
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
2022-09-22 16:04:22 +00:00
|
|
|
= help: remove the inherent method from type `C`
|
2023-07-31 21:53:53 +00:00
|
|
|
= note: `#[deny(clippy::inherent_to_string_shadow_display)]` on by default
|
2019-07-15 16:43:47 +00:00
|
|
|
|
2019-07-16 16:29:37 +00:00
|
|
|
error: aborting due to 2 previous errors
|
2019-07-06 18:13:38 +00:00
|
|
|
|