about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-08 22:16:13 +0000
committerbors <bors@rust-lang.org>2019-01-08 22:16:13 +0000
commit167ceff01ec2f01f677fa6351646255d3dacbb98 (patch)
treefa3a3ea838d5da3d10393bff6e8eeec35e428bc8 /src/test
parentd22fa2d87d03d19fdb1359faab9ec5e74eff26b3 (diff)
parent0b272e740051192344c36f0444d9ef28f2ab31fe (diff)
downloadrust-167ceff01ec2f01f677fa6351646255d3dacbb98.tar.gz
rust-167ceff01ec2f01f677fa6351646255d3dacbb98.zip
Auto merge of #56407 - GuillaumeGomez:missing-docs-reexported-macros, r=varkor
check missing docs for reexported macros as well

Fixes #56334.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/deny-missing-docs-crate.rs13
-rw-r--r--src/test/rustdoc-ui/deny-missing-docs-crate.stderr22
-rw-r--r--src/test/rustdoc-ui/deny-missing-docs-macro.rs18
-rw-r--r--src/test/rustdoc-ui/deny-missing-docs-macro.stderr14
4 files changed, 67 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/deny-missing-docs-crate.rs b/src/test/rustdoc-ui/deny-missing-docs-crate.rs
new file mode 100644
index 00000000000..910c99314e4
--- /dev/null
+++ b/src/test/rustdoc-ui/deny-missing-docs-crate.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![deny(missing_docs)] //~ ERROR
+
+pub struct Foo; //~ ERROR
diff --git a/src/test/rustdoc-ui/deny-missing-docs-crate.stderr b/src/test/rustdoc-ui/deny-missing-docs-crate.stderr
new file mode 100644
index 00000000000..7f0590e0b22
--- /dev/null
+++ b/src/test/rustdoc-ui/deny-missing-docs-crate.stderr
@@ -0,0 +1,22 @@
+error: missing documentation for crate
+  --> $DIR/deny-missing-docs-crate.rs:11:1
+   |
+LL | / #![deny(missing_docs)] //~ ERROR
+LL | |
+LL | | pub struct Foo; //~ ERROR
+   | |_______________^
+   |
+note: lint level defined here
+  --> $DIR/deny-missing-docs-crate.rs:11:9
+   |
+LL | #![deny(missing_docs)] //~ ERROR
+   |         ^^^^^^^^^^^^
+
+error: missing documentation for a struct
+  --> $DIR/deny-missing-docs-crate.rs:13:1
+   |
+LL | pub struct Foo; //~ ERROR
+   | ^^^^^^^^^^^^^^^
+
+error: Compilation failed, aborting rustdoc
+
diff --git a/src/test/rustdoc-ui/deny-missing-docs-macro.rs b/src/test/rustdoc-ui/deny-missing-docs-macro.rs
new file mode 100644
index 00000000000..a12fe17e0cb
--- /dev/null
+++ b/src/test/rustdoc-ui/deny-missing-docs-macro.rs
@@ -0,0 +1,18 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! foo
+
+#![deny(missing_docs)]
+
+#[macro_export]
+macro_rules! foo { //~ ERROR
+    () => {}
+}
diff --git a/src/test/rustdoc-ui/deny-missing-docs-macro.stderr b/src/test/rustdoc-ui/deny-missing-docs-macro.stderr
new file mode 100644
index 00000000000..686a45030e6
--- /dev/null
+++ b/src/test/rustdoc-ui/deny-missing-docs-macro.stderr
@@ -0,0 +1,14 @@
+error: missing documentation for macro
+  --> $DIR/deny-missing-docs-macro.rs:16:1
+   |
+LL | macro_rules! foo { //~ ERROR
+   | ^^^^^^^^^^^^^^^^
+   |
+note: lint level defined here
+  --> $DIR/deny-missing-docs-macro.rs:13:9
+   |
+LL | #![deny(missing_docs)]
+   |         ^^^^^^^^^^^^
+
+error: Compilation failed, aborting rustdoc
+