Closed
Description
To reproduce, run Clippy on the following module:
struct S {}
impl S {
fn to_string(&self, stuff: i32) -> String {
unimplemented!()
}
}
It produces the following warning:
warning: implementation of inherent method `to_string(&self) -> String` for type `S`
--> src\lib.rs:4:5
|
4 | / fn to_string(&self, stuff: i32) -> String {
5 | | unimplemented!()
6 | | }
| |_____^
|
= note: `#[warn(clippy::inherent_to_string)]` on by default
= help: implement trait `Display` for type `S` instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
This is incorrect. My to_string
has different signature and can't be replaced with Display
impl.
> cargo clippy -V
clippy 0.0.212 (05f603e6 2019-08-25)