diff --git a/tests/ui/collection_is_never_read.rs b/tests/ui/collection_is_never_read.rs index 49c72e7eefe..068a49486cf 100644 --- a/tests/ui/collection_is_never_read.rs +++ b/tests/ui/collection_is_never_read.rs @@ -153,3 +153,13 @@ fn method_without_side_effect(&self) {} let y = vec![1, 2, 3]; // Ok (false negative) y.method_without_side_effect(); } + +fn function_argument() { + #[allow(clippy::ptr_arg)] + fn foo(v: &Vec) -> usize { + v.len() + } + + let x = vec![1, 2, 3]; // Ok + foo(&x); +}