From 050b714c9d638d57408d7ff7d14afd5d206525f2 Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Wed, 12 Jul 2023 20:15:54 -0400 Subject: [PATCH] Add "Known problems" section to `needless_borrow` documentation --- clippy_lints/src/dereference.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clippy_lints/src/dereference.rs b/clippy_lints/src/dereference.rs index 3af552e50168..cdf64b960360 100644 --- a/clippy_lints/src/dereference.rs +++ b/clippy_lints/src/dereference.rs @@ -77,6 +77,11 @@ declare_clippy_lint! { /// Suggests that the receiver of the expression borrows /// the expression. /// + /// ### Known problems + /// The lint cannot tell when the implementation of a trait + /// for `&T` and `T` do different things. Removing a borrow + /// in such a case can change the semantics of the code. + /// /// ### Example /// ```rust /// fn fun(_a: &i32) {}