Skip to content

Commit 4ee6553

Browse files
committed
Add test where container is passed to a function
1 parent 85ad8a6 commit 4ee6553

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/ui/collection_is_never_read.rs

+10
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,13 @@ fn extension_traits() {
153153
let y = vec![1, 2, 3]; // Ok (false negative)
154154
y.method_without_side_effect();
155155
}
156+
157+
fn function_argument() {
158+
#[allow(clippy::ptr_arg)]
159+
fn foo<T>(v: &Vec<T>) -> usize {
160+
v.len()
161+
}
162+
163+
let x = vec![1, 2, 3]; // Ok
164+
foo(&x);
165+
}

0 commit comments

Comments
 (0)