Skip to content

Commit 89a4558

Browse files
committed
Add Known Problem for multiple lifetimes
1 parent 58459ab commit 89a4558

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/trivially_copy_pass_by_ref.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ use crate::utils::{in_macro, is_copy, is_self, span_lint_and_sugg, snippet};
3131
/// The configuration option `trivial_copy_size_limit` can be set to override
3232
/// this limit for a project.
3333
///
34+
/// This lint attempts to allow passing arguments by reference if a reference
35+
/// to that argument is returned. This is implemented by comparing the lifetime
36+
/// of the argument and return value for equality. However, this can cause
37+
/// false positives in cases involving multiple lifetimes that are bounded by
38+
/// each other.
39+
///
3440
/// **Example:**
3541
/// ```rust
3642
/// fn foo(v: &u32) {

0 commit comments

Comments
 (0)