1 #![warn(clippy::wrong_self_convention)]
18 pub fn as_i64(self) {}
19 pub fn into_i64(self) {}
20 pub fn is_i64(self) {}
21 pub fn to_i64(self) {}
22 pub fn from_i64(self) {}
23 // check whether the lint can be allowed at the function level
24 #[allow(clippy::wrong_self_convention)]
25 pub fn from_cake(self) {}
27 fn as_x<F: AsRef<Self>>(_: F) {}
28 fn as_y<F: AsRef<Foo>>(_: F) {}
44 pub fn as_i64(self) {}
45 pub fn into_i64(&self) {}
46 pub fn is_i64(self) {}
47 pub fn to_i64(self) {}
48 pub fn from_i64(self) {}
50 // test for false positives
56 fn to_mut(&mut self) {}
59 // Allow Box<Self>, Rc<Self>, Arc<Self> for methods that take conventionally take Self by value
60 #[allow(clippy::boxed_local)]
68 fn into_s1(self: Box<Self>) {}
69 fn into_s2(self: Rc<Self>) {}
70 fn into_s3(self: Arc<Self>) {}
72 fn into_t1(self: Box<T>) {}
73 fn into_t2(self: Rc<T>) {}
74 fn into_t3(self: Arc<T>) {}
78 // False positive for async (see #4037)
84 pub async fn into_bar(self) -> Bar {
90 // Lint also in trait definition (see #6307)
96 fn into_i32_ref(&self) {}
103 // check whether the lint can be allowed at the function level
104 #[allow(clippy::wrong_self_convention)]
105 fn from_cake(self) {}
107 // test for false positives
113 fn to_mut(&mut self) {}
120 fn into_i32_ref(&self);
127 // check whether the lint can be allowed at the function level
128 #[allow(clippy::wrong_self_convention)]
131 // test for false positives
137 fn to_mut(&mut self);
144 fn into_i32_ref(&self);
151 // check whether the lint can be allowed at the function level
152 #[allow(clippy::wrong_self_convention)]
155 // test for false positives
161 fn to_mut(&mut self);
166 #[derive(Clone, Copy)]
170 fn to_u64(self) -> u64 {
174 fn to_u64_v2(&self) -> u64 {
183 fn to_u64(self) -> u64 {
186 fn to_u64_v2(&self) -> u64 {
196 // Should not lint: "no self at all" is allowed.
197 fn is_forty_two(x: u32) -> bool {
201 // Should not lint: &self is allowed.
202 fn is_test_code(&self) -> bool {