about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-31 09:04:37 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-31 09:04:37 +0530
commit2c0329cfa8ff70365e3fc02a75e31ef82b2cdc75 (patch)
tree399090ddd7329d1ef151ffc991a740d82d992c92 /src/test
parente76b41276318352643773d2eeb58c6f68c03724e (diff)
parent31a52852009958c58828ebf174cfd609503602e1 (diff)
downloadrust-2c0329cfa8ff70365e3fc02a75e31ef82b2cdc75.tar.gz
rust-2c0329cfa8ff70365e3fc02a75e31ef82b2cdc75.zip
Rollup merge of #23852 - cmr:missing_doc, r=Manishearth
Due to a long-standing conservative approach to trait exports, all traits are
considered exported. However, the missing_docs lint uses the export map to
determine if something is public and ought to have documentation. This commit
modifies the lint to check if traits are private before emitting the warning.

Closes #11592
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-11592.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-11592.rs b/src/test/run-pass/issue-11592.rs
new file mode 100644
index 00000000000..432e7ff2025
--- /dev/null
+++ b/src/test/run-pass/issue-11592.rs
@@ -0,0 +1,20 @@
+// Copyright 2015 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.
+
+//! Ensure the private trait Bar isn't complained about.
+
+#![deny(missing_docs)]
+
+mod foo {
+    trait Bar { fn bar(&self) { } }
+    impl Bar for i8 { fn bar(&self) { } }
+}
+
+fn main() { }