Skip to content

Commit f565efd

Browse files
committed
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.
1 parent 57d7cfc commit f565efd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustdoc/clean/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ impl<'a, 'tcx, 'rcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx, 'rcx>
165165
match module.inner {
166166
ModuleItem(ref module) => {
167167
for it in &module.items {
168-
if it.is_extern_crate() && it.attrs.has_doc_flag("masked") {
168+
// `compiler_builtins` should be masked too, but we can't apply
169+
// `#[doc(masked)]` to the injected `extern crate` because it's unstable.
170+
if it.is_extern_crate()
171+
&& (it.attrs.has_doc_flag("masked")
172+
|| self.cx.tcx.is_compiler_builtins(it.def_id.krate))
173+
{
169174
masked_crates.insert(it.def_id.krate);
170175
}
171176
}

0 commit comments

Comments
 (0)