]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/lint.rs
auto merge of #10165 : dcrewi/rust/missing-doc-on-private-trait, r=cmr
[rust.git] / src / librustc / middle / lint.rs
index e8f9dad65851beab32e35424518e4cedc13c323d..4517e19f48e3edd138a5d7bab809821df8619372 100644 (file)
@@ -951,10 +951,9 @@ fn visit_item(&mut self, it: @ast::item, _: ()) {
             // trait (which was already linted)
             ast::item_impl(_, Some(*), _, _) => return,
 
-            ast::item_trait(*) if it.vis == ast::public => {
-                self.check_attrs(it.attrs, it.id, it.span,
-                                 ~"missing documentation for a trait");
-            }
+            ast::item_trait(*) if it.vis != ast::public => return,
+            ast::item_trait(*) => self.check_attrs(it.attrs, it.id, it.span,
+                                                   ~"missing documentation for a trait"),
 
             ast::item_fn(*) if it.vis == ast::public => {
                 self.check_attrs(it.attrs, it.id, it.span,