about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-22 06:51:13 +0000
committerbors <bors@rust-lang.org>2020-08-22 06:51:13 +0000
commitb1bb8aa3ff3bf3040d9973edeb96b8c9ebf81d31 (patch)
treeddef790d0edb366e659fe5123c27cf3ad4b2e29e /src/test/rustdoc-ui/lint-missing-doc-code-example.rs
parentebc03f7c80a7ab8cdf95c0ddc31b57e065906a13 (diff)
parent7a05f13aed27c75f592c89435350c4826174316a (diff)
downloadrust-b1bb8aa3ff3bf3040d9973edeb96b8c9ebf81d31.tar.gz
rust-b1bb8aa3ff3bf3040d9973edeb96b8c9ebf81d31.zip
Auto merge of #75776 - GuillaumeGomez:missing-doc-examples-lint-improvements, r=jyn514
Missing doc examples lint improvements

Fixes #75719.

To be merged after #75718 (only the two last commits are from this PR).

Since you already reviewed #75718, I'll set you as reviewer here as well. :)

r? @jyn514
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.rs31
1 files changed, 31 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
index ffe0ddcd8c9..ebe7a242211 100644
--- a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
+++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
@@ -38,3 +38,34 @@ pub mod module3 {
   //~^ ERROR
   pub fn test() {}
 }
+
+/// Doc, but no code example and it's fine!
+pub const Const: u32 = 0;
+/// Doc, but no code example and it's fine!
+pub static Static: u32 = 0;
+/// Doc, but no code example and it's fine!
+pub type Type = u32;
+
+/// Doc
+//~^ ERROR
+pub struct Struct {
+    /// Doc, but no code example and it's fine!
+    pub field: u32,
+}
+
+/// Doc
+//~^ ERROR
+pub enum Enum {
+    /// Doc, but no code example and it's fine!
+    X,
+}
+
+/// Doc
+//~^ ERROR
+#[repr(C)]
+union Union {
+    /// Doc, but no code example and it's fine!
+    a: i32,
+    /// Doc, but no code example and it's fine!
+    b: f32,
+}