about summary refs log tree commit diff
path: root/tests/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-05 14:54:40 +0000
committerbors <bors@rust-lang.org>2024-01-05 14:54:40 +0000
commit2d6c2386f529f33a2e614727b3e41982940abbdd (patch)
tree9319c82006ad1b12d382756b8fe2bc15000141ff /tests/debuginfo/enum-thinlto.rs
parentee8bfb7f7af0c4ba4a6d200627bb48d0e09dcc17 (diff)
parente75841397365ff207553551f14ab35122774f23c (diff)
downloadrust-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/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions