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.
This commit is contained in:
Andy Russell 2019-02-13 19:57:12 -05:00
parent 57d7cfc3cf
commit f565efd617
No known key found for this signature in database
GPG Key ID: BE2221033EDBC374

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