1
Fork 0

Auto merge of #44026 - QuietMisdreavus:trimmed-std, r=steveklabnik

hide internal types/traits from std docs via new #[doc(masked)] attribute

Fixes #43701 (hopefully for good this time)

This PR introduces a new parameter to the `#[doc]` attribute that rustdoc looks for on `extern crate` statements. When it sees `#[doc(masked)]` on such a statement, it hides traits and types from that crate from appearing in either the "Trait Implementations" section of many type pages, or the "Implementors" section of trait pages. This is then applied to the `libc`/`rand`/`compiler_builtins` imports in libstd to prevent those crates from creating broken links in the std docs.

Like in #43348, this also introduces a feature gate, `doc_masked`, that controls the use of this parameter.

To view the std docs generated with this change, head to https://tonberry.quietmisdreavus.net/std-43701/std/index.html.
This commit is contained in:
bors 2017-09-19 04:20:56 +00:00
commit 9a00f3cc30
6 changed files with 111 additions and 18 deletions

View file

@ -314,6 +314,7 @@
#![feature(unwind_attributes)]
#![feature(vec_push_all)]
#![feature(doc_cfg)]
#![feature(doc_masked)]
#![cfg_attr(test, feature(update_panic_count))]
#![cfg_attr(not(stage0), feature(const_max_value))]
@ -359,19 +360,24 @@ use prelude::v1::*;
debug_assert_ne, unreachable, unimplemented, write, writeln, try)]
extern crate core as __core;
#[allow(deprecated)] extern crate rand as core_rand;
#[doc(masked)]
#[allow(deprecated)]
extern crate rand as core_rand;
#[macro_use]
#[macro_reexport(vec, format)]
extern crate alloc;
extern crate alloc_system;
extern crate std_unicode;
#[doc(masked)]
extern crate libc;
// We always need an unwinder currently for backtraces
#[doc(masked)]
#[allow(unused_extern_crates)]
extern crate unwind;
// compiler-rt intrinsics
#[doc(masked)]
extern crate compiler_builtins;
// During testing, this crate is not actually the "real" std library, but rather