Put back attributes check pass in rustdoc
This commit is contained in:
parent
9d252ba928
commit
51db2a65dd
@ -470,6 +470,10 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
|||||||
sess.time("missing_docs", || {
|
sess.time("missing_docs", || {
|
||||||
rustc_lint::check_crate(tcx, rustc_lint::builtin::MissingDoc::new);
|
rustc_lint::check_crate(tcx, rustc_lint::builtin::MissingDoc::new);
|
||||||
});
|
});
|
||||||
|
for &module in tcx.hir().krate().modules.keys() {
|
||||||
|
let local_def_id = tcx.hir().local_def_id(module);
|
||||||
|
tcx.ensure().check_mod_attrs(local_def_id);
|
||||||
|
}
|
||||||
|
|
||||||
let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
|
let access_levels = tcx.privacy_access_levels(LOCAL_CRATE);
|
||||||
// Convert from a HirId set to a DefId set since we don't always have easy access
|
// Convert from a HirId set to a DefId set since we don't always have easy access
|
||||||
|
10
src/test/rustdoc-ui/check-doc-alias-attr.rs
Normal file
10
src/test/rustdoc-ui/check-doc-alias-attr.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![crate_type = "lib"]
|
||||||
|
#![feature(doc_alias)]
|
||||||
|
|
||||||
|
#[doc(alias = "foo")] // ok!
|
||||||
|
pub struct Bar;
|
||||||
|
|
||||||
|
#[doc(alias)] //~ ERROR
|
||||||
|
#[doc(alias = 0)] //~ ERROR
|
||||||
|
#[doc(alias("bar"))] //~ ERROR
|
||||||
|
pub struct Foo;
|
20
src/test/rustdoc-ui/check-doc-alias-attr.stderr
Normal file
20
src/test/rustdoc-ui/check-doc-alias-attr.stderr
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
error: doc alias attribute expects a string: #[doc(alias = "0")]
|
||||||
|
--> $DIR/check-doc-alias-attr.rs:7:7
|
||||||
|
|
|
||||||
|
LL | #[doc(alias)]
|
||||||
|
| ^^^^^
|
||||||
|
|
||||||
|
error: doc alias attribute expects a string: #[doc(alias = "0")]
|
||||||
|
--> $DIR/check-doc-alias-attr.rs:8:7
|
||||||
|
|
|
||||||
|
LL | #[doc(alias = 0)]
|
||||||
|
| ^^^^^^^^^
|
||||||
|
|
||||||
|
error: doc alias attribute expects a string: #[doc(alias = "0")]
|
||||||
|
--> $DIR/check-doc-alias-attr.rs:9:7
|
||||||
|
|
|
||||||
|
LL | #[doc(alias("bar"))]
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
Loading…
Reference in New Issue
Block a user