Skip to content

Commit 050b714

Browse files
committed
Add "Known problems" section to needless_borrow documentation
1 parent df92b52 commit 050b714

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clippy_lints/src/dereference.rs

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ declare_clippy_lint! {
7777
/// Suggests that the receiver of the expression borrows
7878
/// the expression.
7979
///
80+
/// ### Known problems
81+
/// The lint cannot tell when the implementation of a trait
82+
/// for `&T` and `T` do different things. Removing a borrow
83+
/// in such a case can change the semantics of the code.
84+
///
8085
/// ### Example
8186
/// ```rust
8287
/// fn fun(_a: &i32) {}

0 commit comments

Comments
 (0)