1 // normalize-stderr-test "\(\d+ byte\)" -> "(N byte)"
2 // normalize-stderr-test "\(limit: \d+ byte\)" -> "(limit: N byte)"
5 clippy::many_single_char_names,
6 clippy::blacklisted_name,
7 clippy::redundant_field_names
10 #[derive(Copy, Clone)]
13 #[derive(Copy, Clone)]
16 #[derive(Copy, Clone)]
30 fn good(a: &mut u32, b: u32, c: &Bar) {}
32 fn good_return_implicit_lt_ref(foo: &Foo) -> &u32 {
36 #[allow(clippy::needless_lifetimes)]
37 fn good_return_explicit_lt_ref<'a>(foo: &'a Foo) -> &'a u32 {
41 fn good_return_implicit_lt_struct(foo: &Foo) -> FooRef {
45 #[allow(clippy::needless_lifetimes)]
46 fn good_return_explicit_lt_struct<'a>(foo: &'a Foo) -> FooRef<'a> {
50 fn bad(x: &u32, y: &Foo, z: &Baz) {}
53 fn good(self, a: &mut u32, b: u32, c: &Bar) {}
55 fn good2(&mut self) {}
57 fn bad(&self, x: &u32, y: &Foo, z: &Baz) {}
59 fn bad2(x: &u32, y: &Foo, z: &Baz) {}
62 impl AsRef<u32> for Foo {
63 fn as_ref(&self) -> &u32 {
69 fn good(&self, a: &mut u32, b: u32, c: &Bar) {}
71 fn bad2(x: &u32, y: &Foo, z: &Baz) {}
75 fn trait_method(&self, _foo: &Foo);
79 fn trait_method2(&self, _color: &Color);
82 impl MyTrait for Foo {
83 fn trait_method(&self, _foo: &Foo) {
88 #[allow(unused_variables)]
91 #[allow(clippy::trivially_copy_pass_by_ref)]
95 #[allow(clippy::trivially_copy_pass_by_ref)]
100 let (mut foo, bar) = (Foo(0), Bar([0; 24]));
101 let (mut a, b, c, x, y, z) = (0, 0, Bar([0; 24]), 0, Foo(0), 0);
103 good_return_implicit_lt_ref(&y);
104 good_return_explicit_lt_ref(&y);
106 foo.good(&mut a, b, &c);
109 Foo::bad2(&x, &y, &z);
110 bar.good(&mut a, b, &c);
111 Bar::bad2(&x, &y, &z);