about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-22 10:04:41 +0000
committerbors <bors@rust-lang.org>2018-11-22 10:04:41 +0000
commit93fa2d76bd9a8ffbbb46df2da6d27c13ee7fa73e (patch)
tree35b359452ea12e799c831d01c01262ec7fc1d4ec /src/test/rustdoc-ui
parentf3adec65dd0b05a0a30cd2c134f252e8bece0b76 (diff)
parent61d7b3e9b028ba1a682448e8bdc6212552ce1ff3 (diff)
downloadrust-93fa2d76bd9a8ffbbb46df2da6d27c13ee7fa73e.tar.gz
rust-93fa2d76bd9a8ffbbb46df2da6d27c13ee7fa73e.zip
Auto merge of #56155 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests

Successful merges:

 - #55367 (lint if a private item has doctests)
 - #55485 (Return &T / &mut T in ManuallyDrop Deref(Mut) impl)
 - #55784 (Clarifying documentation for collections::hash_map::Entry::or_insert)
 - #55961 (Fix VecDeque pretty-printer)
 - #55980 (Suggest on closure args count mismatching with pipe span)
 - #56002 (fix #55972: Erroneous self arguments on bare functions emit subpar compilation error)
 - #56063 (Update any.rs documentation using keyword dyn)
 - #56067 (Add SGX target to rustc)
 - #56078 (Fix error message for `-C panic=xxx`.)
 - #56106 (Remove some incorrect doc comments)
 - #56126 (core/benches/num: Add `from_str/from_str_radix()` benchmarks)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test/rustdoc-ui')
-rw-r--r--src/test/rustdoc-ui/private-item-doc-test.rs20
-rw-r--r--src/test/rustdoc-ui/private-item-doc-test.stderr16
2 files changed, 36 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/private-item-doc-test.rs b/src/test/rustdoc-ui/private-item-doc-test.rs
new file mode 100644
index 00000000000..5a13fe359f5
--- /dev/null
+++ b/src/test/rustdoc-ui/private-item-doc-test.rs
@@ -0,0 +1,20 @@
+// 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(private_doc_tests)]
+
+mod foo {
+    /// private doc test
+    ///
+    /// ```
+    /// assert!(false);
+    /// ```
+    fn bar() {}
+}
diff --git a/src/test/rustdoc-ui/private-item-doc-test.stderr b/src/test/rustdoc-ui/private-item-doc-test.stderr
new file mode 100644
index 00000000000..b43add7ea50
--- /dev/null
+++ b/src/test/rustdoc-ui/private-item-doc-test.stderr
@@ -0,0 +1,16 @@
+error: Documentation test in private item
+  --> $DIR/private-item-doc-test.rs:14:5
+   |
+LL | /     /// private doc test
+LL | |     ///
+LL | |     /// ```
+LL | |     /// assert!(false);
+LL | |     /// ```
+   | |___________^
+   |
+note: lint level defined here
+  --> $DIR/private-item-doc-test.rs:11:9
+   |
+LL | #![deny(private_doc_tests)]
+   |         ^^^^^^^^^^^^^^^^^
+