summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/suspicious_doc_comments.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/suspicious_doc_comments.rs')
-rw-r--r--src/tools/clippy/tests/ui/suspicious_doc_comments.rs81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/suspicious_doc_comments.rs b/src/tools/clippy/tests/ui/suspicious_doc_comments.rs
new file mode 100644
index 000000000..46eff51e2
--- /dev/null
+++ b/src/tools/clippy/tests/ui/suspicious_doc_comments.rs
@@ -0,0 +1,81 @@
+// run-rustfix
+#![allow(unused)]
+#![warn(clippy::suspicious_doc_comments)]
+
+//! Real module documentation.
+///! Fake module documentation.
+fn baz() {}
+
+pub mod singleline_outer_doc {
+ ///! This module contains useful functions.
+
+ pub fn bar() {}
+}
+
+pub mod singleline_inner_doc {
+ //! This module contains useful functions.
+
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc {
+ /**! This module contains useful functions.
+ */
+
+ pub fn bar() {}
+}
+
+pub mod multiline_inner_doc {
+ /*! This module contains useful functions.
+ */
+
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc2 {
+ ///! This module
+ ///! contains
+ ///! useful functions.
+
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc3 {
+ ///! a
+ ///! b
+
+ /// c
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc4 {
+ ///! a
+ /// b
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc_gap {
+ ///! a
+
+ ///! b
+ pub fn bar() {}
+}
+
+pub mod multiline_outer_doc_commented {
+ /////! This outer doc comment was commented out.
+ pub fn bar() {}
+}
+
+pub mod outer_doc_macro {
+ ///! Very cool macro
+ macro_rules! x {
+ () => {};
+ }
+}
+
+pub mod useless_outer_doc {
+ ///! Huh.
+ use std::mem;
+}
+
+fn main() {}