mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add test where container is passed to a function
This commit is contained in:
parent
85ad8a6fdc
commit
4ee65535a7
@ -153,3 +153,13 @@ fn extension_traits() {
|
||||
let y = vec![1, 2, 3]; // Ok (false negative)
|
||||
y.method_without_side_effect();
|
||||
}
|
||||
|
||||
fn function_argument() {
|
||||
#[allow(clippy::ptr_arg)]
|
||||
fn foo<T>(v: &Vec<T>) -> usize {
|
||||
v.len()
|
||||
}
|
||||
|
||||
let x = vec![1, 2, 3]; // Ok
|
||||
foo(&x);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user