Skip to content

Commit 366234a

Browse files
committed
Add unnecessary_to_owned "Known problems" section
1 parent a4ebf6f commit 366234a

File tree

1 file changed

+5
-0
lines changed
  • clippy_lints/src/methods

1 file changed

+5
-0
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,11 @@ declare_clippy_lint! {
18951895
/// ### Why is this bad?
18961896
/// The unnecessary calls result in useless allocations.
18971897
///
1898+
/// ### Known problems
1899+
/// `unnecessary_to_owned` can falsely trigger if `IntoIterator::into_iter` is applied to an
1900+
/// owned copy of a resource and the resource is later used mutably. See
1901+
/// [#8148](https://github.com/rust-lang/rust-clippy/issues/8148).
1902+
///
18981903
/// ### Example
18991904
/// ```rust
19001905
/// let path = std::path::Path::new("x");

0 commit comments

Comments
 (0)