diff options
| author | Eljay <lee@leejeffery.co.uk> | 2015-06-21 16:02:05 +0100 |
|---|---|---|
| committer | Eljay <lee@leejeffery.co.uk> | 2015-06-21 16:02:05 +0100 |
| commit | 00130cff99f88e13fec87378bdf476cfea6aa147 (patch) | |
| tree | d230af73d8f1dcfbc997ef599d9badb05f24f1f7 | |
| parent | a38e7585fc29289581e6cefcdf9e201c3d58ed14 (diff) | |
| download | rust-00130cff99f88e13fec87378bdf476cfea6aa147.tar.gz rust-00130cff99f88e13fec87378bdf476cfea6aa147.zip | |
Fix `missing_docs` lint for const and static.
| -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 a4681acdd75..53b1abe2d31 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1612,6 +1612,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 04db6c8c8f3..55018358861 100644 --- a/src/test/compile-fail/lint-missing-doc.rs +++ b/src/test/compile-fail/lint-missing-doc.rs @@ -149,6 +149,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() {} |
