Skip to content

Commit e0c01ca

Browse files
committed
auto merge of #10165 : dcrewi/rust/missing-doc-on-private-trait, r=cmr
Fixes #10069.
2 parents 3899f8d + ba436a8 commit e0c01ca

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustc/middle/lint.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,9 @@ impl Visitor<()> for MissingDocLintVisitor {
951951
// trait (which was already linted)
952952
ast::item_impl(_, Some(*), _, _) => return,
953953

954-
ast::item_trait(*) if it.vis == ast::public => {
955-
self.check_attrs(it.attrs, it.id, it.span,
956-
~"missing documentation for a trait");
957-
}
954+
ast::item_trait(*) if it.vis != ast::public => return,
955+
ast::item_trait(*) => self.check_attrs(it.attrs, it.id, it.span,
956+
~"missing documentation for a trait"),
958957

959958
ast::item_fn(*) if it.vis == ast::public => {
960959
self.check_attrs(it.attrs, it.id, it.span,

src/test/compile-fail/lint-missing-doc.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ pub trait C {} //~ ERROR: missing documentation
4545
#[allow(missing_doc)] pub trait D {}
4646

4747
trait Bar {
48-
/// dox
4948
fn foo();
50-
fn foo2(); //~ ERROR: missing documentation
51-
fn foo3(); //~ ERROR: missing documentation
49+
fn foo_with_impl() {
50+
}
5251
}
5352

5453
impl Foo {

0 commit comments

Comments
 (0)