diff options
| author | bors <bors@rust-lang.org> | 2024-01-05 14:54:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-05 14:54:40 +0000 |
| commit | 2d6c2386f529f33a2e614727b3e41982940abbdd (patch) | |
| tree | 9319c82006ad1b12d382756b8fe2bc15000141ff /tests/ui/patchable-function-entry/patchable-function-entry-flags.rs | |
| parent | ee8bfb7f7af0c4ba4a6d200627bb48d0e09dcc17 (diff) | |
| parent | e75841397365ff207553551f14ab35122774f23c (diff) | |
| download | rust-2d6c2386f529f33a2e614727b3e41982940abbdd.tar.gz rust-2d6c2386f529f33a2e614727b3e41982940abbdd.zip | |
Auto merge of #12091 - samueltardieu:issue-12068, r=Alexendoo
Add .as_ref() to suggestion to remove .to_string() The case of `.to_owned().split(…)` is treated specially in the `unnecessary_to_owned` lint. Test cases check that it works both for slices and for strings, but they missed a corner case: `x.to_string().split(…)` when `x` implements `AsRef<str>` but not `Deref<Target = str>`. In this case, it is wrong to suggest to remove `.to_string()` without adding `.as_ref()` instead. Fix #12068 changelog: [`unnecessary_to_owned`]: suggest replacing `.to_string()` by `.as_ref()`
Diffstat (limited to 'tests/ui/patchable-function-entry/patchable-function-entry-flags.rs')
0 files changed, 0 insertions, 0 deletions
