Files
rust/tests/ui
bors 05de787089 Auto merge of #10913 - y21:issue10033, r=Manishearth,Centri3
[`unnecessary_to_owned`]: check that the adjusted type matches target

Fixes #10033.

Before this change, the lint would assume that removing the `.to_string()` in `f(&x.to_string())` would be ok if x is of some type that implements `Deref<Target = str>` and `f` takes a `&str`.
This turns out to not actually be ok if the `to_string` call is some method that exists on `x` directly, which happens if it implements `Display`/`ToString` itself.

changelog: [`unnecessary_to_owned`]: only lint if the adjusted receiver type actually matches
2023-06-09 08:52:44 +00:00
..
…
2023-05-24 11:06:56 -05:00
2023-05-24 11:06:56 -05:00
…
…
…
2023-06-06 14:58:54 -04:00
…
2023-05-31 17:30:23 -05:00
2023-05-31 17:30:23 -05:00
…
…
2023-06-07 22:57:15 +02:00
…
…
…
…
2023-06-06 22:56:57 +02:00
2023-06-06 22:56:57 +02:00
…
2023-06-06 22:56:57 +02:00
2023-05-21 15:07:53 +02:00
2023-06-02 14:46:27 +02:00
2023-06-02 14:46:27 +02:00
2023-06-06 22:56:57 +02:00
…
…
2023-06-02 13:26:12 -05:00
2023-06-02 13:26:12 -05:00
…
2023-06-06 22:56:57 +02:00
…
…
2023-05-22 23:00:28 -04:00
2023-05-22 23:00:28 -04:00
2023-05-22 20:02:45 -04:00
2023-05-22 23:00:28 -04:00
2023-05-22 23:00:28 -04:00
2023-05-22 20:02:45 -04:00
2023-06-06 22:56:57 +02:00
2023-06-06 22:56:57 +02:00
2023-06-06 22:56:57 +02:00
…
…
…