From b3f95f460f6c35985bf7b3e6220b1370e0323312 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 9 Sep 2019 10:27:01 -0700 Subject: Move `--cfg bootstrap` out of `rustc.rs` Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently requires a submodule update of `stdarch` to fix a problem with previous compilers. --- src/libcore/bool.rs | 2 +- src/libcore/clone.rs | 2 +- src/libcore/cmp.rs | 8 ++++---- src/libcore/default.rs | 2 +- src/libcore/fmt/mod.rs | 6 +++--- src/libcore/hash/mod.rs | 2 +- src/libcore/intrinsics.rs | 12 ++++++------ src/libcore/lib.rs | 2 +- src/libcore/macros.rs | 4 ++-- src/libcore/marker.rs | 2 +- src/libcore/num/mod.rs | 24 ++++++++++++------------ 11 files changed, 33 insertions(+), 33 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/bool.rs b/src/libcore/bool.rs index 32ec26975e3..f751ccb4280 100644 --- a/src/libcore/bool.rs +++ b/src/libcore/bool.rs @@ -1,6 +1,6 @@ //! impl bool {} -#[cfg(not(boostrap_stdarch_ignore_this))] +#[cfg(not(bootstrap))] #[lang = "bool"] impl bool { /// Returns `Some(t)` if the `bool` is `true`, or `None` otherwise. diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index ec70d396e96..6bdae1b557d 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -135,7 +135,7 @@ pub trait Clone : Sized { /// Derive macro generating an impl of the trait `Clone`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics, derive_clone_copy)] pub macro Clone($item:item) { /* compiler built-in */ } diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 4e2b1627e15..fc7329f57d4 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -210,7 +210,7 @@ pub trait PartialEq { /// Derive macro generating an impl of the trait `PartialEq`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro PartialEq($item:item) { /* compiler built-in */ } @@ -273,7 +273,7 @@ pub trait Eq: PartialEq { /// Derive macro generating an impl of the trait `Eq`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics, derive_eq)] pub macro Eq($item:item) { /* compiler built-in */ } @@ -624,7 +624,7 @@ pub trait Ord: Eq + PartialOrd { /// Derive macro generating an impl of the trait `Ord`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro Ord($item:item) { /* compiler built-in */ } @@ -873,7 +873,7 @@ pub trait PartialOrd: PartialEq { /// Derive macro generating an impl of the trait `PartialOrd`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro PartialOrd($item:item) { /* compiler built-in */ } diff --git a/src/libcore/default.rs b/src/libcore/default.rs index 66acc5165fc..806d4783107 100644 --- a/src/libcore/default.rs +++ b/src/libcore/default.rs @@ -117,7 +117,7 @@ pub trait Default: Sized { /// Derive macro generating an impl of the trait `Default`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro Default($item:item) { /* compiler built-in */ } diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 7e35188bc10..65e2f8b9be6 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -518,8 +518,8 @@ impl Display for Arguments<'_> { label="`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{Debug}`", )] #[doc(alias = "{:?}")] -#[cfg_attr(boostrap_stdarch_ignore_this, lang = "debug_trait")] -#[cfg_attr(not(boostrap_stdarch_ignore_this), rustc_diagnostic_item = "debug_trait")] +#[cfg_attr(bootstrap, lang = "debug_trait")] +#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "debug_trait")] pub trait Debug { /// Formats the value using the given formatter. /// @@ -550,7 +550,7 @@ pub trait Debug { pub(crate) mod macros { /// Derive macro generating an impl of the trait `Debug`. #[rustc_builtin_macro] - #[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] + #[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro Debug($item:item) { /* compiler built-in */ } diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index bf3daa32840..aaaa6f9c575 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -202,7 +202,7 @@ pub trait Hash { pub(crate) mod macros { /// Derive macro generating an impl of the trait `Hash`. #[rustc_builtin_macro] - #[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] + #[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics)] pub macro Hash($item:item) { /* compiler built-in */ } diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index ecff40a7597..905375eb60f 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -1299,38 +1299,38 @@ extern "rust-intrinsic" { /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_add` method. For example, /// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add) - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] pub fn overflowing_add(a: T, b: T) -> T; /// Returns (a - b) mod 2N, where N is the width of T in bits. /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_sub` method. For example, /// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub) - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] pub fn overflowing_sub(a: T, b: T) -> T; /// Returns (a * b) mod 2N, where N is the width of T in bits. /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_mul` method. For example, /// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul) - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] pub fn overflowing_mul(a: T, b: T) -> T; /// Returns (a + b) mod 2N, where N is the width of T in bits. /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_add` method. For example, /// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add) - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] pub fn wrapping_add(a: T, b: T) -> T; /// Returns (a - b) mod 2N, where N is the width of T in bits. /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_sub` method. For example, /// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub) - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] pub fn wrapping_sub(a: T, b: T) -> T; /// Returns (a * b) mod 2N, where N is the width of T in bits. /// The stabilized versions of this intrinsic are available on the integer /// primitives via the `wrapping_mul` method. For example, /// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul) - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] pub fn wrapping_mul(a: T, b: T) -> T; /// Computes `a + b`, while saturating at numeric bounds. diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index a2cc585fc51..5c681b3a5d8 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -87,7 +87,7 @@ #![feature(link_llvm_intrinsics)] #![feature(never_type)] #![feature(nll)] -#![cfg_attr(boostrap_stdarch_ignore_this, feature(bind_by_move_pattern_guards))] +#![cfg_attr(bootstrap, feature(bind_by_move_pattern_guards))] #![feature(exhaustive_patterns)] #![feature(no_core)] #![feature(on_unimplemented)] diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 384bc874998..c6f5fb0b163 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -1236,9 +1236,9 @@ pub(crate) mod builtin { pub macro test($item:item) { /* compiler built-in */ } /// Attribute macro applied to a function to turn it into a benchmark test. - #[cfg_attr(not(boostrap_stdarch_ignore_this), unstable(soft, feature = "test", issue = "50297", + #[cfg_attr(not(bootstrap), unstable(soft, feature = "test", issue = "50297", reason = "`bench` is a part of custom test frameworks which are unstable"))] - #[cfg_attr(boostrap_stdarch_ignore_this, unstable(feature = "test", issue = "50297", + #[cfg_attr(bootstrap, unstable(feature = "test", issue = "50297", reason = "`bench` is a part of custom test frameworks which are unstable"))] #[allow_internal_unstable(test, rustc_attrs)] #[rustc_builtin_macro] diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 347e7dce6e6..a2cfb320e76 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -290,7 +290,7 @@ pub trait Copy : Clone { /// Derive macro generating an impl of the trait `Copy`. #[rustc_builtin_macro] -#[cfg_attr(boostrap_stdarch_ignore_this, rustc_macro_transparency = "semitransparent")] +#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[allow_internal_unstable(core_intrinsics, derive_clone_copy)] pub macro Copy($item:item) { /* compiler built-in */ } diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 0cf2ebb487d..5d99c10e738 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1112,11 +1112,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_add(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_add(self, rhs) } } @@ -1141,11 +1141,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_sub(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_sub(self, rhs) } } @@ -1169,11 +1169,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_mul(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_mul(self, rhs) } } @@ -3040,11 +3040,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_add(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_add(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_add(self, rhs) } } @@ -3068,11 +3068,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_sub(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_sub(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_sub(self, rhs) } } @@ -3097,11 +3097,11 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_mul(self, rhs: Self) -> Self { - #[cfg(boostrap_stdarch_ignore_this)] { + #[cfg(bootstrap)] { intrinsics::overflowing_mul(self, rhs) } - #[cfg(not(boostrap_stdarch_ignore_this))] { + #[cfg(not(bootstrap))] { intrinsics::wrapping_mul(self, rhs) } } -- cgit 1.4.1-3-g733a5 From 1a8897fd8a988cc3c81b7cb985005d6cf836116c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 23 Sep 2019 09:35:50 -0700 Subject: Fix rebase conflicts --- src/libcore/panicking.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcore') diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs index 3d2bc24bf24..7b7253419b1 100644 --- a/src/libcore/panicking.rs +++ b/src/libcore/panicking.rs @@ -71,7 +71,7 @@ pub fn panic_fmt(fmt: fmt::Arguments<'_>, file_line_col: &(&'static str, u32, u3 } // NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call - #[cfg_attr(boostrap_stdarch_ignore_this, allow(improper_ctypes))] + #[cfg_attr(bootstrap, allow(improper_ctypes))] extern "Rust" { #[lang = "panic_impl"] fn panic_impl(pi: &PanicInfo<'_>) -> !; -- cgit 1.4.1-3-g733a5