From 89a4558056914dc5e4e709a18039e843c8b5e566 Mon Sep 17 00:00:00 2001 From: Ryan Cumming Date: Mon, 23 Jul 2018 19:33:52 +1000 Subject: [PATCH] Add Known Problem for multiple lifetimes --- clippy_lints/src/trivially_copy_pass_by_ref.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs index e0eb464596b5..d27f4f061cbb 100644 --- a/clippy_lints/src/trivially_copy_pass_by_ref.rs +++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs @@ -31,6 +31,12 @@ use crate::utils::{in_macro, is_copy, is_self, span_lint_and_sugg, snippet}; /// The configuration option `trivial_copy_size_limit` can be set to override /// this limit for a project. /// +/// This lint attempts to allow passing arguments by reference if a reference +/// to that argument is returned. This is implemented by comparing the lifetime +/// of the argument and return value for equality. However, this can cause +/// false positives in cases involving multiple lifetimes that are bounded by +/// each other. +/// /// **Example:** /// ```rust /// fn foo(v: &u32) {