Put back attributes check pass in rustdoc

This commit is contained in:
Guillaume Gomez 2020-08-01 16:22:20 +02:00
parent 9d252ba928
commit 51db2a65dd
3 changed files with 34 additions and 0 deletions

View File

@ -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

View 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;

View 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