Skip to content

Commit 51db2a6

Browse files
Put back attributes check pass in rustdoc
1 parent 9d252ba commit 51db2a6

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/librustdoc/core.rs

+4
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
470470
sess.time("missing_docs", || {
471471
rustc_lint::check_crate(tcx, rustc_lint::builtin::MissingDoc::new);
472472
});
473+
for &module in tcx.hir().krate().modules.keys() {
474+
let local_def_id = tcx.hir().local_def_id(module);
475+
tcx.ensure().check_mod_attrs(local_def_id);
476+
}
473477

474478
let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
475479
// Convert from a HirId set to a DefId set since we don't always have easy access
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![crate_type = "lib"]
2+
#![feature(doc_alias)]
3+
4+
#[doc(alias = "foo")] // ok!
5+
pub struct Bar;
6+
7+
#[doc(alias)] //~ ERROR
8+
#[doc(alias = 0)] //~ ERROR
9+
#[doc(alias("bar"))] //~ ERROR
10+
pub struct Foo;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: doc alias attribute expects a string: #[doc(alias = "0")]
2+
--> $DIR/check-doc-alias-attr.rs:7:7
3+
|
4+
LL | #[doc(alias)]
5+
| ^^^^^
6+
7+
error: doc alias attribute expects a string: #[doc(alias = "0")]
8+
--> $DIR/check-doc-alias-attr.rs:8:7
9+
|
10+
LL | #[doc(alias = 0)]
11+
| ^^^^^^^^^
12+
13+
error: doc alias attribute expects a string: #[doc(alias = "0")]
14+
--> $DIR/check-doc-alias-attr.rs:9:7
15+
|
16+
LL | #[doc(alias("bar"))]
17+
| ^^^^^^^^^^^^
18+
19+
error: aborting due to 3 previous errors
20+

0 commit comments

Comments
 (0)