1 #![warn(clippy::unused_self)]
2 #![allow(clippy::boxed_local, clippy::fn_params_excessive_bools)]
6 use std::sync::{Arc, Mutex};
11 fn unused_self_move(self) {}
12 fn unused_self_ref(&self) {}
13 fn unused_self_mut_ref(&mut self) {}
14 fn unused_self_pin_ref(self: Pin<&Self>) {}
15 fn unused_self_pin_mut_ref(self: Pin<&mut Self>) {}
16 fn unused_self_pin_nested(self: Pin<Arc<Self>>) {}
17 fn unused_self_box(self: Box<Self>) {}
18 fn unused_with_other_used_args(&self, x: u8, y: u8) -> u8 {
21 fn unused_self_class_method(&self) {
22 Self::static_method();
29 mod unused_self_allow {
34 #[allow(clippy::unused_self)]
35 fn unused_self_move(self) {}
41 #[allow(clippy::unused_self)]
43 fn unused_self_move(self) {}
48 #[allow(clippy::unused_self)]
50 #[warn(clippy::unused_self)]
54 fn unused_self_move(self) {}
60 // shouldn't trigger for public methods
61 pub fn unused_self_move(self) {}
65 pub use unused_self_allow::D;
75 fn used_self_move(self) -> u8 {
78 fn used_self_ref(&self) -> u8 {
81 fn used_self_mut_ref(&mut self) {
84 fn used_self_pin_ref(self: Pin<&Self>) -> u8 {
87 fn used_self_box(self: Box<Self>) -> u8 {
90 fn used_self_with_other_unused_args(&self, x: u8, y: u8) -> u8 {
93 fn used_in_nested_closure(&self) -> u8 {
94 let mut a = || -> u8 { self.x };
98 #[allow(clippy::collapsible_if)]
99 fn used_self_method_nested_conditions(&self, a: bool, b: bool, c: bool, d: bool) {
104 self.used_self_ref();
111 fn foo(&self) -> u32 {
119 fn bar(&mut self, x: u8) -> u32 {
134 impl fmt::Debug for A {
135 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
141 fn method(x: u8, y: u8) {}