Skip to content

Commit

Permalink
Auto merge of #11148 - smoelius:nb-known-problems, r=Jarcho
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jul 13, 2023
2 parents df92b52 + 050b714 commit b10a0aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clippy_lints/src/dereference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit b10a0aa

Please sign in to comment.