Skip to content

Commit a84c299

Browse files
committed
Require module documentation with missing_doc
Closes #9824
1 parent 4d2a402 commit a84c299

File tree

18 files changed

+44
-1
lines changed

18 files changed

+44
-1
lines changed

src/libextra/crypto/digest.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Common functionality related to cryptographic digest functions
12+
1113
use std::vec;
1214

1315
use hex::ToHex;

src/libextra/crypto/md5.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use std::iter::range_step;
1214

1315
use cryptoutil::{write_u32_le, read_u32v_le, FixedBuffer, FixedBuffer64, StandardPadding};

src/libextra/crypto/sha2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use std::iter::range_step;
1214

1315
use cryptoutil::{write_u64_be, write_u32_be, read_u64v_be, read_u32v_be, add_bytes_to_bits,

src/libextra/enum_set.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! A structure for holding a set of enum variants
12+
//!
13+
//! This module defines a container which uses an efficient bit mask
14+
//! representation to hold C-like enum variants.
15+
1116
#[deriving(Clone, Eq, IterBytes, ToStr)]
1217
/// A specialized Set implementation to use enum types.
1318
pub struct EnumSet<E> {

src/libextra/io_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use std::io::{Reader, BytesReader};
1214
use std::io;
1315
use std::cast;

src/libextra/md4.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
1112

1213
use std::vec;
1314

src/libextra/rl.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Bindings for the ability to read lines of input from the console
12+
1113
use std::c_str::ToCStr;
1214
use std::libc::{c_char, c_int};
1315
use std::{local_data, str, rt};
1416
use std::unstable::finally::Finally;
1517

16-
pub mod rustrt {
18+
mod rustrt {
1719
use std::libc::{c_char, c_int};
1820

1921
externfn!(fn linenoise(prompt: *c_char) -> *c_char)

src/libextra/stats.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use sort;
1214
use std::cmp;
1315
use std::hashmap;

src/libextra/sync.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
/**
1214
* The concurrency primitives you know and love.
1315
*

src/libextra/terminfo/terminfo.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use std::hashmap::HashMap;
1214

1315
/// A parsed terminfo entry.

src/librustc/middle/lint.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,11 @@ impl Visitor<()> for MissingDocLintVisitor {
955955
~"missing documentation for a function");
956956
}
957957

958+
ast::item_mod(*) if it.vis == ast::public => {
959+
self.check_attrs(it.attrs, it.id, it.span,
960+
~"missing documentation for a module");
961+
}
962+
958963
ast::item_enum(ref edef, _) if it.vis == ast::public => {
959964
self.check_attrs(it.attrs, it.id, it.span,
960965
~"missing documentation for an enum");

src/libstd/at_vec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ impl<T> Clone for @[T] {
135135
}
136136

137137
#[cfg(not(test))]
138+
#[allow(missing_doc)]
138139
pub mod traits {
139140
use at_vec::append;
140141
use clone::Clone;
@@ -152,6 +153,7 @@ pub mod traits {
152153
#[cfg(test)]
153154
pub mod traits {}
154155

156+
#[allow(missing_doc)]
155157
pub mod raw {
156158
use at_vec::capacity;
157159
use cast;

src/libstd/fmt/parse.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
//! Parsing of format strings
12+
//!
13+
//! These structures are used when parsing format strings for the compiler.
14+
//! Parsing does not currently happen at runtime (structures of std::fmt::rt are
15+
//! generated instead).
16+
1117
use prelude::*;
1218

1319
use char;

src/libstd/select.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(missing_doc)];
12+
1113
use cell::Cell;
1214
use comm;
1315
use container::Container;

src/libstd/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ Section: Trait implementations
12531253
*/
12541254
12551255
#[cfg(not(test))]
1256+
#[allow(missing_doc)]
12561257
pub mod traits {
12571258
use ops::Add;
12581259
use cmp::{TotalOrd, Ordering, Less, Equal, Greater, Eq, Ord, Equiv, TotalEq};

src/libstd/vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ impl<'self, T> RandomAccessIterator<&'self [T]> for ChunkIter<'self, T> {
603603
// Equality
604604

605605
#[cfg(not(test))]
606+
#[allow(missing_doc)]
606607
pub mod traits {
607608
use super::*;
608609

src/libsyntax/ext/expand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ pub fn std_macros() -> @str {
991991
pub mod $c {
992992
#[allow(unused_imports)];
993993
#[allow(non_uppercase_statics)];
994+
#[allow(missing_doc)];
994995

995996
use super::*;
996997

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pub struct PubFoo2 {
2929
c: int,
3030
}
3131

32+
mod module_no_dox {}
33+
pub mod pub_module_no_dox {} //~ ERROR: missing documentation
34+
3235
/// dox
3336
pub fn foo() {}
3437
pub fn foo2() {} //~ ERROR: missing documentation

0 commit comments

Comments
 (0)