Skip to content

Commit b10a0aa

Browse files
committed
Auto merge of #11148 - smoelius:nb-known-problems, r=Jarcho
Add "Known problems" section to `needless_borrow` documentation While this PR doesn't fix the issue in #11142, it at least communicates that this is a known limitation. r? `@Jarcho` changelog: Add "Known problems" section to `needless_borrow` documentation
2 parents df92b52 + 050b714 commit b10a0aa

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)