1 #![feature(tool_lints)]
3 #![allow(unused, clippy::many_single_char_names)]
4 #![warn(clippy::ptr_arg)]
8 fn do_vec(x: &Vec<i64>) {
12 fn do_vec_mut(x: &mut Vec<i64>) { // no error here
16 fn do_str(x: &String) {
20 fn do_str_mut(x: &mut String) { // no error here
29 fn do_vec(x: &Vec<i64>);
30 fn do_item(x: &Self::Item);
35 // no error, in trait impl (#425)
38 fn do_vec(x: &Vec<i64>) {}
39 fn do_item(x: &Vec<u8>) {}
42 fn cloned(x: &Vec<u8>) -> Vec<u8> {
44 let f = e.clone(); // OK
46 let h = g.clone(); // Alas, we cannot reliably detect this without following data.
51 fn str_cloned(x: &String) -> String {
61 fn false_positive_capacity(x: &Vec<u8>, y: &String) {
67 fn false_positive_capacity_too(x: &String) -> String {
68 if x.capacity() > 1024 { panic!("Too large!"); }
73 fn test_cow_with_ref(c: &Cow<[i32]>) {
77 fn test_cow(c: Cow<[i32]>) {
85 // no error for &self references where self is of type String (#2293)
86 impl Foo2 for String { fn do_string(&self) {} }