2 #![warn(clippy::wrong_self_convention)]
3 #![warn(clippy::wrong_pub_self_convention)]
20 pub fn as_i64(self) {}
21 pub fn into_i64(self) {}
22 pub fn is_i64(self) {}
23 pub fn to_i64(self) {}
24 pub fn from_i64(self) {}
25 // check whether the lint can be allowed at the function level
26 #[allow(clippy::wrong_self_convention)]
27 pub fn from_cake(self) {}
29 fn as_x<F: AsRef<Self>>(_: F) {}
30 fn as_y<F: AsRef<Foo>>(_: F) {}
46 pub fn as_i64(self) {}
47 pub fn into_i64(&self) {}
48 pub fn is_i64(self) {}
49 pub fn to_i64(self) {}
50 pub fn from_i64(self) {}
52 // test for false positives
58 fn to_mut(&mut self) {}
61 // Allow Box<Self>, Rc<Self>, Arc<Self> for methods that take conventionally take Self by value
62 #[allow(clippy::boxed_local)]
70 fn into_s1(self: Box<Self>) {}
71 fn into_s2(self: Rc<Self>) {}
72 fn into_s3(self: Arc<Self>) {}
74 fn into_t1(self: Box<T>) {}
75 fn into_t2(self: Rc<T>) {}
76 fn into_t3(self: Arc<T>) {}
80 // False positive for async (see #4037)
86 pub async fn into_bar(self) -> Bar {
92 // Lint also in trait definition (see #6307)
98 fn into_i32_ref(&self) {}
105 // check whether the lint can be allowed at the function level
106 #[allow(clippy::wrong_self_convention)]
107 fn from_cake(self) {}
109 // test for false positives
115 fn to_mut(&mut self) {}
122 fn into_i32_ref(&self);
129 // check whether the lint can be allowed at the function level
130 #[allow(clippy::wrong_self_convention)]
133 // test for false positives
139 fn to_mut(&mut self);
146 fn into_i32_ref(&self);
153 // check whether the lint can be allowed at the function level
154 #[allow(clippy::wrong_self_convention)]
157 // test for false positives
163 fn to_mut(&mut self);
169 fn to_u64(self) -> u64;
170 fn to_u64_v2(&self) -> u64;
173 #[derive(Clone, Copy)]
176 impl ToU64 for FooCopy {
177 fn to_u64(self) -> u64 {
181 fn to_u64_v2(&self) -> u64 {
188 impl ToU64 for FooNoCopy {
190 fn to_u64(self) -> u64 {
193 fn to_u64_v2(&self) -> u64 {