about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-18 21:05:42 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-01-18 21:05:42 +0900
commitff0a22d99ff9dfbaa849db2cd9d23a77fa2b97a1 (patch)
tree9d9391aa74a7ec1f64c29be80fdf5f2ae600a9b4 /tests
parente36a33fac779458b65ae6b45c692a1700b08e506 (diff)
downloadrust-ff0a22d99ff9dfbaa849db2cd9d23a77fa2b97a1.tar.gz
rust-ff0a22d99ff9dfbaa849db2cd9d23a77fa2b97a1.zip
Allow `unused_self` lint at the function level
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/unused_self.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/unused_self.rs b/tests/ui/unused_self.rs
index 9119c43c082..711c1cd9d6c 100644
--- a/tests/ui/unused_self.rs
+++ b/tests/ui/unused_self.rs
@@ -26,6 +26,24 @@ mod unused_self {
     }
 }
 
+mod unused_self_allow {
+    struct A {}
+
+    impl A {
+        // shouldn't trigger
+        #[allow(clippy::unused_self)]
+        fn unused_self_move(self) {}
+    }
+
+    struct B {}
+
+    // shouldn't trigger
+    #[allow(clippy::unused_self)]
+    impl B {
+        fn unused_self_move(self) {}
+    }
+}
+
 mod used_self {
     use std::pin::Pin;