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
This commit is contained in:
bors 2023-07-13 01:22:10 +00:00
commit b10a0aa057

View File

@ -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) {}