diff options
| author | bors <bors@rust-lang.org> | 2015-08-11 14:42:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-08-11 14:42:23 +0000 |
| commit | 91c618f133a35ffccc7e03e06f9318c59d091ae3 (patch) | |
| tree | a6da5e42a555aa6b442a02cb73405e0a2fe9dd36 /src | |
| parent | 1af31d4974e33027a68126fa5a5a3c2c6491824f (diff) | |
| parent | e0d7497fb8a25e9b64518574faabe579519bebc9 (diff) | |
| download | rust-91c618f133a35ffccc7e03e06f9318c59d091ae3.tar.gz rust-91c618f133a35ffccc7e03e06f9318c59d091ae3.zip | |
Auto merge of #27575 - brson:lint, r=alexcrichton
This reverts commit 9191a7895574ec3aa5a9b84ce0008d91e32ccd6a. This was reverted previously until the `--cap-lints` option was implemented.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_lint/builtin.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/lint-missing-doc.rs | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 8f5519faf7a..c1e5fee2dcb 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1870,6 +1870,8 @@ impl LintPass for MissingDoc { } return }, + ast::ItemConst(..) => "a constant", + ast::ItemStatic(..) => "a static", _ => return }; diff --git a/src/test/compile-fail/lint-missing-doc.rs b/src/test/compile-fail/lint-missing-doc.rs index c98d7083743..4add67f61e0 100644 --- a/src/test/compile-fail/lint-missing-doc.rs +++ b/src/test/compile-fail/lint-missing-doc.rs @@ -150,6 +150,27 @@ pub enum PubBaz3 { #[doc(hidden)] pub fn baz() {} + +const FOO: u32 = 0; +/// dox +pub const FOO1: u32 = 0; +#[allow(missing_docs)] +pub const FOO2: u32 = 0; +#[doc(hidden)] +pub const FOO3: u32 = 0; +pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const + + +static BAR: u32 = 0; +/// dox +pub static BAR1: u32 = 0; +#[allow(missing_docs)] +pub static BAR2: u32 = 0; +#[doc(hidden)] +pub static BAR3: u32 = 0; +pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static + + mod internal_impl { /// dox pub fn documented() {} |
