3 #![warn(clippy::use_self)]
5 #![allow(clippy::should_implement_trait, clippy::boxed_local)]
10 fn refs(p1: &Self) -> &Self;
11 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self;
12 fn mut_refs(p1: &mut Self) -> &mut Self;
13 fn nested(p1: Box<Self>, p2: (&u8, &Self));
14 fn vals(r: Self) -> Self;
20 impl SelfTrait for Bad {
21 fn refs(p1: &Bad) -> &Bad {
25 fn ref_refs<'a>(p1: &'a &'a Bad) -> &'a &'a Bad {
29 fn mut_refs(p1: &mut Bad) -> &mut Bad {
33 fn nested(_p1: Box<Bad>, _p2: (&u8, &Bad)) {}
35 fn vals(_: Bad) -> Bad {
43 fn mul(self, rhs: Bad) -> Bad {
49 fn clone(&self) -> Self {
57 impl SelfTrait for Good {
58 fn refs(p1: &Self) -> &Self {
62 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self {
66 fn mut_refs(p1: &mut Self) -> &mut Self {
70 fn nested(_p1: Box<Self>, _p2: (&u8, &Self)) {}
72 fn vals(_: Self) -> Self {
80 fn mul(self, rhs: Self) -> Self {
86 fn refs(p1: &u8) -> &u8;
87 fn ref_refs<'a>(p1: &'a &'a u8) -> &'a &'a u8;
88 fn mut_refs(p1: &mut u8) -> &mut u8;
89 fn nested(p1: Box<u8>, p2: (&u8, &u8));
90 fn vals(p1: u8) -> u8;
93 // Using `Self` instead of the type name is OK
94 impl NameTrait for u8 {
95 fn refs(p1: &Self) -> &Self {
99 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self {
103 fn mut_refs(p1: &mut Self) -> &mut Self {
107 fn nested(_p1: Box<Self>, _p2: (&Self, &Self)) {}
109 fn vals(_: Self) -> Self {