Skip to content

Commit

Permalink
use cfg(rustdoc) instead of cfg(dox) in std and friends
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Aug 31, 2018
1 parent d7e496f commit ad2169c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/bootstrap/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ fn main() {
let mut dylib_path = bootstrap::util::dylib_path();
dylib_path.insert(0, PathBuf::from(libdir.clone()));

//FIXME(misdreavus): once stdsimd uses cfg(rustdoc) instead of cfg(dox), remove the `--cfg dox`
//arguments here
let mut cmd = Command::new(rustdoc);
cmd.args(&args)
.arg("--cfg")
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ macro_rules! unimplemented {
/// into libsyntax itself.
///
/// For more information, see documentation for `std`'s macros.
#[cfg(dox)]
#[cfg(rustdoc)]
mod builtin {

/// Unconditionally causes compilation to fail with the given error message when encountered.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ macro_rules! assert_approx_eq {
/// These macros do not have any corresponding definition with a `macro_rules!`
/// macro, but are documented here. Their implementations can be found hardcoded
/// into libsyntax itself.
#[cfg(dox)]
#[cfg(rustdoc)]
mod builtin {

/// Unconditionally causes compilation to fail with the given error message when encountered.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#![allow(missing_docs, bad_style, missing_debug_implementations)]

cfg_if! {
if #[cfg(dox)] {
if #[cfg(rustdoc)] {

// When documenting libstd we want to show unix/windows/linux modules as
// these are the "main modules" that are used across platforms. This
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ cfg_if! {
// then later used in the `std::os` module when documenting, for example,
// Windows when we're compiling for Linux.

#[cfg(dox)]
#[cfg(rustdoc)]
cfg_if! {
if #[cfg(any(unix, target_os = "redox"))] {
// On unix we'll document what's already available
Expand All @@ -77,7 +77,7 @@ cfg_if! {
}
}

#[cfg(dox)]
#[cfg(rustdoc)]
cfg_if! {
if #[cfg(windows)] {
// On windows we'll just be documenting what's already available
Expand Down
32 changes: 16 additions & 16 deletions src/libstd/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
use io::{self, ErrorKind};
use libc;

#[cfg(any(dox, target_os = "linux"))] pub use os::linux as platform;

#[cfg(all(not(dox), target_os = "android"))] pub use os::android as platform;
#[cfg(all(not(dox), target_os = "bitrig"))] pub use os::bitrig as platform;
#[cfg(all(not(dox), target_os = "dragonfly"))] pub use os::dragonfly as platform;
#[cfg(all(not(dox), target_os = "freebsd"))] pub use os::freebsd as platform;
#[cfg(all(not(dox), target_os = "haiku"))] pub use os::haiku as platform;
#[cfg(all(not(dox), target_os = "ios"))] pub use os::ios as platform;
#[cfg(all(not(dox), target_os = "macos"))] pub use os::macos as platform;
#[cfg(all(not(dox), target_os = "netbsd"))] pub use os::netbsd as platform;
#[cfg(all(not(dox), target_os = "openbsd"))] pub use os::openbsd as platform;
#[cfg(all(not(dox), target_os = "solaris"))] pub use os::solaris as platform;
#[cfg(all(not(dox), target_os = "emscripten"))] pub use os::emscripten as platform;
#[cfg(all(not(dox), target_os = "fuchsia"))] pub use os::fuchsia as platform;
#[cfg(all(not(dox), target_os = "l4re"))] pub use os::linux as platform;
#[cfg(all(not(dox), target_os = "hermit"))] pub use os::hermit as platform;
#[cfg(any(rustdoc, target_os = "linux"))] pub use os::linux as platform;

#[cfg(all(not(rustdoc), target_os = "android"))] pub use os::android as platform;
#[cfg(all(not(rustdoc), target_os = "bitrig"))] pub use os::bitrig as platform;
#[cfg(all(not(rustdoc), target_os = "dragonfly"))] pub use os::dragonfly as platform;
#[cfg(all(not(rustdoc), target_os = "freebsd"))] pub use os::freebsd as platform;
#[cfg(all(not(rustdoc), target_os = "haiku"))] pub use os::haiku as platform;
#[cfg(all(not(rustdoc), target_os = "ios"))] pub use os::ios as platform;
#[cfg(all(not(rustdoc), target_os = "macos"))] pub use os::macos as platform;
#[cfg(all(not(rustdoc), target_os = "netbsd"))] pub use os::netbsd as platform;
#[cfg(all(not(rustdoc), target_os = "openbsd"))] pub use os::openbsd as platform;
#[cfg(all(not(rustdoc), target_os = "solaris"))] pub use os::solaris as platform;
#[cfg(all(not(rustdoc), target_os = "emscripten"))] pub use os::emscripten as platform;
#[cfg(all(not(rustdoc), target_os = "fuchsia"))] pub use os::fuchsia as platform;
#[cfg(all(not(rustdoc), target_os = "l4re"))] pub use os::linux as platform;
#[cfg(all(not(rustdoc), target_os = "hermit"))] pub use os::hermit as platform;

pub use self::rand::hashmap_random_keys;
pub use libc::strlen;
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ pub struct FLOATING_SAVE_AREA {
// will not appear in the final documentation. This should be also defined for
// other architectures supported by Windows such as ARM, and for historical
// interest, maybe MIPS and PowerPC as well.
#[cfg(all(dox, not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"))))]
#[cfg(all(rustdoc, not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"))))]
pub enum CONTEXT {}

#[cfg(target_arch = "aarch64")]
Expand Down

0 comments on commit ad2169c

Please sign in to comment.