diff options
| author | Samuel E. Moelius III <sam@moeli.us> | 2022-01-08 09:09:52 -0500 |
|---|---|---|
| committer | Samuel E. Moelius III <sam@moeli.us> | 2022-01-08 09:09:52 -0500 |
| commit | 366234a515ab6538c83e5b58481b2c45abd72d76 (patch) | |
| tree | ac7a7c8e1a6b46ce3d89718fd6ef70fb9d62deb6 | |
| parent | a4ebf6f78e8a3f586251e7d0e4c72af51b436de5 (diff) | |
| download | rust-366234a515ab6538c83e5b58481b2c45abd72d76.tar.gz rust-366234a515ab6538c83e5b58481b2c45abd72d76.zip | |
Add `unnecessary_to_owned` "Known problems" section
| -rw-r--r-- | clippy_lints/src/methods/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 4e33b2ff14c..6572c7111b3 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -1895,6 +1895,11 @@ declare_clippy_lint! { /// ### Why is this bad? /// The unnecessary calls result in useless allocations. /// + /// ### Known problems + /// `unnecessary_to_owned` can falsely trigger if `IntoIterator::into_iter` is applied to an + /// owned copy of a resource and the resource is later used mutably. See + /// [#8148](https://github.com/rust-lang/rust-clippy/issues/8148). + /// /// ### Example /// ```rust /// let path = std::path::Path::new("x"); |
