about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/rustdoc-ui/lint-missing-doc-code-example.rs')
-rw-r--r--src/test/rustdoc-ui/lint-missing-doc-code-example.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
new file mode 100644
index 00000000000..3bb1a2b7bef
--- /dev/null
+++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
@@ -0,0 +1,39 @@
+#![deny(missing_docs)]
+#![deny(missing_doc_code_examples)]
+
+//! crate level doc
+//! ```
+//! println!("hello"):
+//! ```
+
+
+/// doc
+///
+/// ```
+/// println!("hello");
+/// ```
+fn test() {
+}
+
+#[allow(missing_docs)]
+mod module1 {
+}
+
+#[allow(missing_doc_code_examples)]
+/// doc
+mod module2 {
+
+  /// doc
+  pub fn test() {}
+}
+
+/// doc
+///
+/// ```
+/// println!("hello");
+/// ```
+pub mod module3 {
+
+  /// doc
+  pub fn test() {}
+}