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: &Self) -> &Self {
25 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self {
29 fn mut_refs(p1: &mut Self) -> &mut Self {
33 fn nested(_p1: Box<Self>, _p2: (&u8, &Self)) {}
35 fn vals(_: Self) -> Self {
43 fn mul(self, rhs: Self) -> Self {
49 fn clone(&self) -> Self {
50 // FIXME: applicable here
58 impl SelfTrait for Good {
59 fn refs(p1: &Self) -> &Self {
63 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self {
67 fn mut_refs(p1: &mut Self) -> &mut Self {
71 fn nested(_p1: Box<Self>, _p2: (&u8, &Self)) {}
73 fn vals(_: Self) -> Self {
81 fn mul(self, rhs: Self) -> Self {
87 fn refs(p1: &u8) -> &u8;
88 fn ref_refs<'a>(p1: &'a &'a u8) -> &'a &'a u8;
89 fn mut_refs(p1: &mut u8) -> &mut u8;
90 fn nested(p1: Box<u8>, p2: (&u8, &u8));
91 fn vals(p1: u8) -> u8;
94 // Using `Self` instead of the type name is OK
95 impl NameTrait for u8 {
96 fn refs(p1: &Self) -> &Self {
100 fn ref_refs<'a>(p1: &'a &'a Self) -> &'a &'a Self {
104 fn mut_refs(p1: &mut Self) -> &mut Self {
108 fn nested(_p1: Box<Self>, _p2: (&Self, &Self)) {}
110 fn vals(_: Self) -> Self {