mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
5a28d8f01e
fix false positive in Issue/12098 because lack of consideration of mutable caller fixes [Issue#12098](https://github.com/rust-lang/rust-clippy/issues/12098) In issue#12098, the former code doesn't consider the caller for clone is mutable, and suggests to delete clone function. In this change, we first get the inner caller requests for clone, and if it's immutable, the following code will suggest deleting clone. If it's mutable, the loop will check whether a borrow check violation exists, if exists, the lint should not execute, and the function will directly return; otherwise, the following code will handle this. changelog: [`clippy::unnecessary_to_owned`]: fix false positive |
||
---|---|---|
.. | ||
test_utils | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
workspace_test | ||
check-fmt.rs | ||
clippy.toml | ||
compile-test.rs | ||
dogfood.rs | ||
headers.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs | ||
workspace.rs |