diff options
| author | Andy Russell <arussell123@gmail.com> | 2019-02-13 19:57:12 -0500 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2019-02-13 19:57:50 -0500 |
| commit | f565efd617fc2b74bca7fa637faf9c6241008442 (patch) | |
| tree | fcfd40ac20e84b702b0186096f76049b95a114e3 | |
| parent | 57d7cfc3cf50f0c427ad3043ff09eaef20671320 (diff) | |
| download | rust-f565efd617fc2b74bca7fa637faf9c6241008442.tar.gz rust-f565efd617fc2b74bca7fa637faf9c6241008442.zip | |
mask `compiler_builtins` docs
Since `compiler_builtins` is being injected automatically, its docs aren't masked. This commit masks the crate's docs if it's brought in as an extern crate.
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index b0bb033b94b..3044704718b 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -165,7 +165,12 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx> match module.inner { ModuleItem(ref module) => { for it in &module.items { - if it.is_extern_crate() && it.attrs.has_doc_flag("masked") { + // `compiler_builtins` should be masked too, but we can't apply + // `#[doc(masked)]` to the injected `extern crate` because it's unstable. + if it.is_extern_crate() + && (it.attrs.has_doc_flag("masked") + || self.cx.tcx.is_compiler_builtins(it.def_id.krate)) + { masked_crates.insert(it.def_id.krate); } } |
