From a74a0471ce4c46df81b0fefe630f5cf66f7d4b0d Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 2 Apr 2024 16:19:55 -0400 Subject: [PATCH] Put basic impls for f16 and f128 behind cfg(not(bootstrap)) We will lose `f16` and `f128` in the beta compiler after the revert for lands. Change what was added in to be behind `#[cfg(not(bootstrap))]` to account for this. --- library/core/src/clone.rs | 5 ++++- library/core/src/cmp.rs | 10 ++++++++-- library/core/src/lib.rs | 4 ++-- library/core/src/marker.rs | 8 +++++++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index d448c5338fc46..44ae72bcd26bf 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -227,10 +227,13 @@ mod impls { impl_clone! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 - f16 f32 f64 f128 + f32 f64 bool char } + #[cfg(not(bootstrap))] + impl_clone! { f16 f128 } + #[unstable(feature = "never_type", issue = "35121")] impl Clone for ! { #[inline] diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index fa218600ed925..81bba927554a4 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -1497,9 +1497,12 @@ mod impls { } partial_eq_impl! { - bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128 + bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f32 f64 } + #[cfg(not(bootstrap))] + partial_eq_impl! { f16 f128 } + macro_rules! eq_impl { ($($t:ty)*) => ($( #[stable(feature = "rust1", since = "1.0.0")] @@ -1550,7 +1553,10 @@ mod impls { } } - partial_ord_impl! { f16 f32 f64 f128 } + partial_ord_impl! { f32 f64 } + + #[cfg(not(bootstrap))] + partial_ord_impl! { f16 f128 } macro_rules! ord_impl { ($($t:ty)*) => ($( diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 0cc3ad1ead7f6..ba19ca1f45d7c 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -205,6 +205,8 @@ // // Language features: // tidy-alphabetical-start +#![cfg_attr(not(bootstrap), feature(f128))] +#![cfg_attr(not(bootstrap), feature(f16))] #![feature(abi_unadjusted)] #![feature(adt_const_params)] #![feature(allow_internal_unsafe)] @@ -229,8 +231,6 @@ #![feature(doc_notable_trait)] #![feature(effects)] #![feature(extern_types)] -#![feature(f128)] -#![feature(f16)] #![feature(freeze_impls)] #![feature(fundamental)] #![feature(generic_arg_infer)] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 1d073a6d649b8..fb97b3bfa0926 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -422,11 +422,17 @@ marker_impls! { Copy for usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128, - f16, f32, f64, f128, + f32, f64, bool, char, {T: ?Sized} *const T, {T: ?Sized} *mut T, +} +#[cfg(not(bootstrap))] +marker_impls! { + #[stable(feature = "rust1", since = "1.0.0")] + Copy for + f16, f128, } #[unstable(feature = "never_type", issue = "35121")]