about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/doc_unsafe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/doc_unsafe.rs')
-rw-r--r--src/tools/clippy/tests/ui/doc_unsafe.rs21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/tools/clippy/tests/ui/doc_unsafe.rs b/src/tools/clippy/tests/ui/doc_unsafe.rs
index 484aa72d59a..8f823f1672b 100644
--- a/src/tools/clippy/tests/ui/doc_unsafe.rs
+++ b/src/tools/clippy/tests/ui/doc_unsafe.rs
@@ -34,16 +34,25 @@ mod private_mod {
 
 pub use private_mod::republished;
 
-pub trait UnsafeTrait {
+pub trait SafeTraitUnsafeMethods {
     unsafe fn woefully_underdocumented(self);
 
     /// # Safety
     unsafe fn at_least_somewhat_documented(self);
 }
 
+pub unsafe trait UnsafeTrait {
+    fn method();
+}
+
+/// # Safety
+pub unsafe trait DocumentedUnsafeTrait {
+    fn method2();
+}
+
 pub struct Struct;
 
-impl UnsafeTrait for Struct {
+impl SafeTraitUnsafeMethods for Struct {
     unsafe fn woefully_underdocumented(self) {
         // all is well
     }
@@ -53,6 +62,14 @@ impl UnsafeTrait for Struct {
     }
 }
 
+unsafe impl UnsafeTrait for Struct {
+    fn method() {}
+}
+
+unsafe impl DocumentedUnsafeTrait for Struct {
+    fn method2() {}
+}
+
 impl Struct {
     pub unsafe fn more_undocumented_unsafe() -> Self {
         unimplemented!();