1 #![allow(unused, clippy::many_single_char_names)]
2 #![warn(clippy::ptr_arg)]
6 fn do_vec(x: &Vec<i64>) {
10 fn do_vec_mut(x: &mut Vec<i64>) {
15 fn do_str(x: &String) {
19 fn do_str_mut(x: &mut String) {
28 fn do_vec(x: &Vec<i64>);
29 fn do_item(x: &Self::Item);
34 // no error, in trait impl (#425)
37 fn do_vec(x: &Vec<i64>) {}
38 fn do_item(x: &Vec<u8>) {}
41 fn cloned(x: &Vec<u8>) -> Vec<u8> {
43 let f = e.clone(); // OK
45 let h = g.clone(); // Alas, we cannot reliably detect this without following data.
50 fn str_cloned(x: &String) -> String {
54 let d = a.clone().clone().clone();
58 fn false_positive_capacity(x: &Vec<u8>, y: &String) {
64 fn false_positive_capacity_too(x: &String) -> String {
65 if x.capacity() > 1024 {
72 fn test_cow_with_ref(c: &Cow<[i32]>) {}
75 fn test_cow(c: Cow<[i32]>) {
83 // no error for &self references where self is of type String (#2293)
84 impl Foo2 for String {
85 fn do_string(&self) {}