You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address `unnecessary_to_owned` false positive
My proposed fix for rust-lang#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:
// rust-lang/rust-clippy#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`.
Closesrust-lang#8759
changelog: none
The logged output it told me to post: http://pastebin.com/J9Bk6ntk
The file that caused it: http://pastebin.com/xFxR65Dn
The crash occurs in both 0.7 and git master. I'm running Arch Linux.
The text was updated successfully, but these errors were encountered: