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) {}
66 fn used_self_move(self) -> u8 {
69 fn used_self_ref(&self) -> u8 {
72 fn used_self_mut_ref(&mut self) {
75 fn used_self_pin_ref(self: Pin<&Self>) -> u8 {
78 fn used_self_box(self: Box<Self>) -> u8 {
81 fn used_self_with_other_unused_args(&self, x: u8, y: u8) -> u8 {
84 fn used_in_nested_closure(&self) -> u8 {
85 let mut a = || -> u8 { self.x };
89 #[allow(clippy::collapsible_if)]
90 fn used_self_method_nested_conditions(&self, a: bool, b: bool, c: bool, d: bool) {
102 fn foo(&self) -> u32 {
110 fn bar(&mut self, x: u8) -> u32 {
125 impl fmt::Debug for A {
126 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
132 fn method(x: u8, y: u8) {}