Skip to content

Commit 91c618f

Browse files
committed
Auto merge of #27575 - brson:lint, r=alexcrichton
This reverts commit 9191a78. This was reverted previously until the `--cap-lints` option was implemented.
2 parents 1af31d4 + e0d7497 commit 91c618f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/librustc_lint/builtin.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,8 @@ impl LintPass for MissingDoc {
18701870
}
18711871
return
18721872
},
1873+
ast::ItemConst(..) => "a constant",
1874+
ast::ItemStatic(..) => "a static",
18731875
_ => return
18741876
};
18751877

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

+21
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,27 @@ pub enum PubBaz3 {
150150
#[doc(hidden)]
151151
pub fn baz() {}
152152

153+
154+
const FOO: u32 = 0;
155+
/// dox
156+
pub const FOO1: u32 = 0;
157+
#[allow(missing_docs)]
158+
pub const FOO2: u32 = 0;
159+
#[doc(hidden)]
160+
pub const FOO3: u32 = 0;
161+
pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const
162+
163+
164+
static BAR: u32 = 0;
165+
/// dox
166+
pub static BAR1: u32 = 0;
167+
#[allow(missing_docs)]
168+
pub static BAR2: u32 = 0;
169+
#[doc(hidden)]
170+
pub static BAR3: u32 = 0;
171+
pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static
172+
173+
153174
mod internal_impl {
154175
/// dox
155176
pub fn documented() {}

0 commit comments

Comments
 (0)