rust/tests
bors 9c78883fdf Auto merge of #8794 - smoelius:fix-8759, r=llogiq
Address `unnecessary_to_owned` false positive

My proposed fix for #8759 is to revise the conditions that delineate `redundant_clone` and `unnecessary_to_owned`:
```rust
        // Only flag cases satisfying at least one of the following three conditions:
        // * the referent and receiver types are distinct
        // * the referent/receiver type is a copyable array
        // * the method is `Cow::into_owned`
        // This restriction is to ensure there is no overlap between `redundant_clone` and this
        // lint. It also avoids the following false positive:
        //  https://github.com/rust-lang/rust-clippy/issues/8759
        //   Arrays are a bit of a corner case. Non-copyable arrays are handled by
        // `redundant_clone`, but copyable arrays are not.
```
This change causes a few cases that were previously flagged by `unnecessary_to_owned` to no longer be flagged. But one could argue those cases would be better handled by `redundant_clone`.

Closes #8759

changelog: none
2022-05-07 12:31:47 +00:00
..
test_utils
ui Auto merge of #8794 - smoelius:fix-8759, r=llogiq 2022-05-07 12:31:47 +00:00
ui-cargo
ui-internal
ui-toml Add large_include_file lint 2022-04-24 10:08:31 -04:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs
dogfood.rs dogfood: allow unknown lints when not running with internal feature 2022-04-22 13:15:11 +01:00
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs