]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/methods.rs
iterate List by value
[rust.git] / tests / ui / methods.rs
index bc448435829714cb62e836b90e3dbd18931c9464..7880cf36415ff87acc8ba620ceb7712ec8038e35 100644 (file)
@@ -1,11 +1,12 @@
 // aux-build:option_helpers.rs
-// compile-flags: --edition 2018
+// edition:2018
 
 #![warn(clippy::all, clippy::pedantic)]
 #![allow(
     clippy::blacklisted_name,
     clippy::default_trait_access,
     clippy::missing_docs_in_private_items,
+    clippy::missing_safety_doc,
     clippy::non_ascii_literal,
     clippy::new_without_default,
     clippy::needless_pass_by_value,
@@ -83,6 +84,20 @@ fn new(self) -> Self {
     }
 }
 
+pub struct T1;
+
+impl T1 {
+    // Shouldn't trigger lint as it is unsafe.
+    pub unsafe fn add(self, rhs: T1) -> T1 {
+        self
+    }
+
+    // Should not trigger lint since this is an async function.
+    pub async fn next(&mut self) -> Option<T1> {
+        None
+    }
+}
+
 struct Lt<'a> {
     foo: &'a u32,
 }