about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-12 19:02:46 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-10-15 22:27:10 -0700
commita84c2999c91f6ea43291006288ea6dd8c4852c3b (patch)
tree58ed8bd6c4fcde8731b6439cee3b8740df361015
parent4d2a402555aedd04affc978ef05324df7550fd07 (diff)
downloadrust-a84c2999c91f6ea43291006288ea6dd8c4852c3b.tar.gz
rust-a84c2999c91f6ea43291006288ea6dd8c4852c3b.zip
Require module documentation with missing_doc
Closes #9824
-rw-r--r--src/libextra/crypto/digest.rs2
-rw-r--r--src/libextra/crypto/md5.rs2
-rw-r--r--src/libextra/crypto/sha2.rs2
-rw-r--r--src/libextra/enum_set.rs5
-rw-r--r--src/libextra/io_util.rs2
-rw-r--r--src/libextra/md4.rs1
-rw-r--r--src/libextra/rl.rs4
-rw-r--r--src/libextra/stats.rs2
-rw-r--r--src/libextra/sync.rs2
-rw-r--r--src/libextra/terminfo/terminfo.rs2
-rw-r--r--src/librustc/middle/lint.rs5
-rw-r--r--src/libstd/at_vec.rs2
-rw-r--r--src/libstd/fmt/parse.rs6
-rw-r--r--src/libstd/select.rs2
-rw-r--r--src/libstd/str.rs1
-rw-r--r--src/libstd/vec.rs1
-rw-r--r--src/libsyntax/ext/expand.rs1
-rw-r--r--src/test/compile-fail/lint-missing-doc.rs3
18 files changed, 44 insertions, 1 deletions
diff --git a/src/libextra/crypto/digest.rs b/src/libextra/crypto/digest.rs
index 85c256c47a3..372e2313de7 100644
--- a/src/libextra/crypto/digest.rs
+++ b/src/libextra/crypto/digest.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//! Common functionality related to cryptographic digest functions
+
 use std::vec;
 
 use hex::ToHex;
diff --git a/src/libextra/crypto/md5.rs b/src/libextra/crypto/md5.rs
index 5ef113971ab..864fc64f82b 100644
--- a/src/libextra/crypto/md5.rs
+++ b/src/libextra/crypto/md5.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use std::iter::range_step;
 
 use cryptoutil::{write_u32_le, read_u32v_le, FixedBuffer, FixedBuffer64, StandardPadding};
diff --git a/src/libextra/crypto/sha2.rs b/src/libextra/crypto/sha2.rs
index 4a8b62ffd11..fb9a6df50e4 100644
--- a/src/libextra/crypto/sha2.rs
+++ b/src/libextra/crypto/sha2.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use std::iter::range_step;
 
 use cryptoutil::{write_u64_be, write_u32_be, read_u64v_be, read_u32v_be, add_bytes_to_bits,
diff --git a/src/libextra/enum_set.rs b/src/libextra/enum_set.rs
index 242faa2b4da..da9e0a225ba 100644
--- a/src/libextra/enum_set.rs
+++ b/src/libextra/enum_set.rs
@@ -8,6 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//! A structure for holding a set of enum variants
+//!
+//! This module defines a container which uses an efficient bit mask
+//! representation to hold C-like enum variants.
+
 #[deriving(Clone, Eq, IterBytes, ToStr)]
 /// A specialized Set implementation to use enum types.
 pub struct EnumSet<E> {
diff --git a/src/libextra/io_util.rs b/src/libextra/io_util.rs
index b75295ffd22..904ed13eabb 100644
--- a/src/libextra/io_util.rs
+++ b/src/libextra/io_util.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use std::io::{Reader, BytesReader};
 use std::io;
 use std::cast;
diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs
index abce22f98c6..96238986bf1 100644
--- a/src/libextra/md4.rs
+++ b/src/libextra/md4.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
 
 use std::vec;
 
diff --git a/src/libextra/rl.rs b/src/libextra/rl.rs
index 7662a159ba4..c8a17451a70 100644
--- a/src/libextra/rl.rs
+++ b/src/libextra/rl.rs
@@ -8,12 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//! Bindings for the ability to read lines of input from the console
+
 use std::c_str::ToCStr;
 use std::libc::{c_char, c_int};
 use std::{local_data, str, rt};
 use std::unstable::finally::Finally;
 
-pub mod rustrt {
+mod rustrt {
     use std::libc::{c_char, c_int};
 
     externfn!(fn linenoise(prompt: *c_char) -> *c_char)
diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs
index 9ac0d73c2ec..cc6ce715ad3 100644
--- a/src/libextra/stats.rs
+++ b/src/libextra/stats.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use sort;
 use std::cmp;
 use std::hashmap;
diff --git a/src/libextra/sync.rs b/src/libextra/sync.rs
index 75060166f8c..b5b182ea8c5 100644
--- a/src/libextra/sync.rs
+++ b/src/libextra/sync.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 /**
  * The concurrency primitives you know and love.
  *
diff --git a/src/libextra/terminfo/terminfo.rs b/src/libextra/terminfo/terminfo.rs
index 0e0231ad3f4..57e00885b2f 100644
--- a/src/libextra/terminfo/terminfo.rs
+++ b/src/libextra/terminfo/terminfo.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use std::hashmap::HashMap;
 
 /// A parsed terminfo entry.
diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs
index 84cffc0e94c..8b21ce32024 100644
--- a/src/librustc/middle/lint.rs
+++ b/src/librustc/middle/lint.rs
@@ -955,6 +955,11 @@ impl Visitor<()> for MissingDocLintVisitor {
                                  ~"missing documentation for a function");
             }
 
+            ast::item_mod(*) if it.vis == ast::public => {
+                self.check_attrs(it.attrs, it.id, it.span,
+                                 ~"missing documentation for a module");
+            }
+
             ast::item_enum(ref edef, _) if it.vis == ast::public => {
                 self.check_attrs(it.attrs, it.id, it.span,
                                  ~"missing documentation for an enum");
diff --git a/src/libstd/at_vec.rs b/src/libstd/at_vec.rs
index 93a66f6d917..f6669893170 100644
--- a/src/libstd/at_vec.rs
+++ b/src/libstd/at_vec.rs
@@ -135,6 +135,7 @@ impl<T> Clone for @[T] {
 }
 
 #[cfg(not(test))]
+#[allow(missing_doc)]
 pub mod traits {
     use at_vec::append;
     use clone::Clone;
@@ -152,6 +153,7 @@ pub mod traits {
 #[cfg(test)]
 pub mod traits {}
 
+#[allow(missing_doc)]
 pub mod raw {
     use at_vec::capacity;
     use cast;
diff --git a/src/libstd/fmt/parse.rs b/src/libstd/fmt/parse.rs
index a95bd563a81..1b8998b5c6c 100644
--- a/src/libstd/fmt/parse.rs
+++ b/src/libstd/fmt/parse.rs
@@ -8,6 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+//! Parsing of format strings
+//!
+//! These structures are used when parsing format strings for the compiler.
+//! Parsing does not currently happen at runtime (structures of std::fmt::rt are
+//! generated instead).
+
 use prelude::*;
 
 use char;
diff --git a/src/libstd/select.rs b/src/libstd/select.rs
index 049b301144b..8ce23f4b53b 100644
--- a/src/libstd/select.rs
+++ b/src/libstd/select.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(missing_doc)];
+
 use cell::Cell;
 use comm;
 use container::Container;
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index 88497bdaa82..decfbb0785c 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1253,6 +1253,7 @@ Section: Trait implementations
 */
 
 #[cfg(not(test))]
+#[allow(missing_doc)]
 pub mod traits {
     use ops::Add;
     use cmp::{TotalOrd, Ordering, Less, Equal, Greater, Eq, Ord, Equiv, TotalEq};
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 77e38b48067..f31dbfec78a 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -603,6 +603,7 @@ impl<'self, T> RandomAccessIterator<&'self [T]> for ChunkIter<'self, T> {
 // Equality
 
 #[cfg(not(test))]
+#[allow(missing_doc)]
 pub mod traits {
     use super::*;
 
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index c936cb9ab90..1114e3a9893 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -991,6 +991,7 @@ pub fn std_macros() -> @str {
             pub mod $c {
                 #[allow(unused_imports)];
                 #[allow(non_uppercase_statics)];
+                #[allow(missing_doc)];
 
                 use super::*;
 
diff --git a/src/test/compile-fail/lint-missing-doc.rs b/src/test/compile-fail/lint-missing-doc.rs
index 372bf803ec4..22710ad90e8 100644
--- a/src/test/compile-fail/lint-missing-doc.rs
+++ b/src/test/compile-fail/lint-missing-doc.rs
@@ -29,6 +29,9 @@ pub struct PubFoo2 {
     c: int,
 }
 
+mod module_no_dox {}
+pub mod pub_module_no_dox {} //~ ERROR: missing documentation
+
 /// dox
 pub fn foo() {}
 pub fn foo2() {} //~ ERROR: missing documentation