From 31a52852009958c58828ebf174cfd609503602e1 Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Sun, 29 Mar 2015 23:41:54 -0400 Subject: lint: handle private traits better 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 --- src/test/run-pass/issue-11592.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/run-pass/issue-11592.rs (limited to 'src/test') 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 or the MIT license +// , 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() { } -- cgit 1.4.1-3-g733a5