]> git.lizzy.rs Git - rust.git/commitdiff
mask `compiler_builtins` docs
authorAndy Russell <arussell123@gmail.com>
Thu, 14 Feb 2019 00:57:12 +0000 (19:57 -0500)
committerAndy Russell <arussell123@gmail.com>
Thu, 14 Feb 2019 00:57:50 +0000 (19:57 -0500)
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.

src/librustdoc/clean/mod.rs

index b0bb033b94b251809108ba3d32ef8c0b710aa109..3044704718b4ada6837e6a31c58dd277bb635008 100644 (file)
@@ -165,7 +165,12 @@ fn clean(&self, cx: &DocContext) -> Crate {
         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);
                     }
                 }