Add unnecessary_to_owned "Known problems" section

This commit is contained in:
Samuel E. Moelius III 2022-01-08 09:09:52 -05:00
parent a4ebf6f78e
commit 366234a515

View file

@ -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");