From be681fefed254c06139ab055b07cfd6f8b30bacf Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Fri, 25 Mar 2022 02:44:16 -0400 Subject: [PATCH 1/4] Add `round_ties_even` to `f32` and `f64` --- .../src/intrinsics/mod.rs | 2 ++ .../rustc_codegen_gcc/src/intrinsic/mod.rs | 2 ++ compiler/rustc_codegen_llvm/src/context.rs | 4 +++ compiler/rustc_codegen_llvm/src/intrinsic.rs | 2 ++ .../rustc_hir_analysis/src/check/intrinsic.rs | 2 ++ compiler/rustc_span/src/symbol.rs | 2 ++ library/core/src/intrinsics.rs | 16 ++++++++++ library/std/src/f32.rs | 31 +++++++++++++++++++ library/std/src/f32/tests.rs | 17 ++++++++++ library/std/src/f64.rs | 31 +++++++++++++++++++ library/std/src/f64/tests.rs | 17 ++++++++++ library/std/src/lib.rs | 1 + 12 files changed, 127 insertions(+) diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 0302b843aa226..4851c3fdcb7a7 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -297,6 +297,8 @@ fn codegen_float_intrinsic_call<'tcx>( sym::truncf64 => ("trunc", 1, fx.tcx.types.f64), sym::roundf32 => ("roundf", 1, fx.tcx.types.f32), sym::roundf64 => ("round", 1, fx.tcx.types.f64), + sym::roundevenf32 => ("roundevenf", 1, fx.tcx.types.f32), + sym::roundevenf64 => ("roundeven", 1, fx.tcx.types.f64), sym::sinf32 => ("sinf", 1, fx.tcx.types.f32), sym::sinf64 => ("sin", 1, fx.tcx.types.f64), sym::cosf32 => ("cosf", 1, fx.tcx.types.f32), diff --git a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs index 49be6c649e652..35e650c65a081 100644 --- a/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs +++ b/compiler/rustc_codegen_gcc/src/intrinsic/mod.rs @@ -68,6 +68,8 @@ fn get_simple_intrinsic<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, name: Symbol) -> sym::nearbyintf64 => "nearbyint", sym::roundf32 => "roundf", sym::roundf64 => "round", + sym::roundevenf32 => "roundevenf", + sym::roundevenf64 => "roundeven", sym::abort => "abort", _ => return None, }; diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs index aa1735f38acfd..697f5b7b64477 100644 --- a/compiler/rustc_codegen_llvm/src/context.rs +++ b/compiler/rustc_codegen_llvm/src/context.rs @@ -745,9 +745,13 @@ impl<'ll> CodegenCx<'ll, '_> { ifn!("llvm.copysign.f32", fn(t_f32, t_f32) -> t_f32); ifn!("llvm.copysign.f64", fn(t_f64, t_f64) -> t_f64); + ifn!("llvm.round.f32", fn(t_f32) -> t_f32); ifn!("llvm.round.f64", fn(t_f64) -> t_f64); + ifn!("llvm.roundeven.f32", fn(t_f32) -> t_f32); + ifn!("llvm.roundeven.f64", fn(t_f64) -> t_f64); + ifn!("llvm.rint.f32", fn(t_f32) -> t_f32); ifn!("llvm.rint.f64", fn(t_f64) -> t_f64); ifn!("llvm.nearbyint.f32", fn(t_f32) -> t_f32); diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index 2f5dd519b2600..4c0b0cde3f09f 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -72,6 +72,8 @@ fn get_simple_intrinsic<'ll>( sym::roundf32 => "llvm.round.f32", sym::roundf64 => "llvm.round.f64", sym::ptr_mask => "llvm.ptrmask", + sym::roundevenf32 => "llvm.roundeven.f32", + sym::roundevenf64 => "llvm.roundeven.f64", _ => return None, }; Some(cx.get_intrinsic(llvm_name)) diff --git a/compiler/rustc_hir_analysis/src/check/intrinsic.rs b/compiler/rustc_hir_analysis/src/check/intrinsic.rs index 69e54b41d4c04..afbcc517751b7 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsic.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsic.rs @@ -300,6 +300,8 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) { sym::nearbyintf64 => (0, vec![tcx.types.f64], tcx.types.f64), sym::roundf32 => (0, vec![tcx.types.f32], tcx.types.f32), sym::roundf64 => (0, vec![tcx.types.f64], tcx.types.f64), + sym::roundevenf32 => (0, vec![tcx.types.f32], tcx.types.f32), + sym::roundevenf64 => (0, vec![tcx.types.f64], tcx.types.f64), sym::volatile_load | sym::unaligned_volatile_load => { (1, vec![tcx.mk_imm_ptr(param(0))], param(0)) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 1fcf8c7a8bf13..6f983f07fc1cf 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1179,6 +1179,8 @@ symbols! { rlib, rotate_left, rotate_right, + roundevenf32, + roundevenf64, roundf32, roundf64, rt, diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 7ed7d767f2fb5..e331dfff6fd60 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1613,6 +1613,22 @@ extern "rust-intrinsic" { /// [`f64::round`](../../std/primitive.f64.html#method.round) pub fn roundf64(x: f64) -> f64; + /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number + /// with an even least significant digit. + /// + /// The stabilized version of this intrinsic is + /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even) + #[cfg(not(bootstrap))] + pub fn roundevenf32(x: f32) -> f32; + + /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number + /// with an even least significant digit. + /// + /// The stabilized version of this intrinsic is + /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even) + #[cfg(not(bootstrap))] + pub fn roundevenf64(x: f64) -> f64; + /// Float addition that allows optimizations based on algebraic rules. /// May assume inputs are finite. /// diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index 4e30076246314..a2c65e0257768 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -78,10 +78,14 @@ impl f32 { /// let f = 3.3_f32; /// let g = -3.3_f32; /// let h = -3.7_f32; + /// let i = 3.5_f32; + /// let j = 4.5_f32; /// /// assert_eq!(f.round(), 3.0); /// assert_eq!(g.round(), -3.0); /// assert_eq!(h.round(), -4.0); + /// assert_eq!(i.round(), 4.0); + /// assert_eq!(j.round(), 5.0); /// ``` #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] @@ -91,6 +95,33 @@ impl f32 { unsafe { intrinsics::roundf32(self) } } + /// Returns the nearest integer to a number. Rounds half-way cases to the number + /// with an even least significant digit. + /// + /// # Examples + /// + /// ``` + /// #![feature(round_ties_even)] + /// + /// let f = 3.3_f32; + /// let g = -3.3_f32; + /// let h = 3.5_f32; + /// let i = 4.5_f32; + /// + /// assert_eq!(f.round_ties_even(), 3.0); + /// assert_eq!(g.round_ties_even(), -3.0); + /// assert_eq!(h.round_ties_even(), 4.0); + /// assert_eq!(i.round_ties_even(), 4.0); + /// ``` + #[cfg(not(bootstrap))] + #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[must_use = "method returns a new number and does not mutate the original value"] + #[unstable(feature = "round_ties_even", issue = "none")] + #[inline] + pub fn round_ties_even(self) -> f32 { + unsafe { intrinsics::roundevenf32(self) } + } + /// Returns the integer part of `self`. /// This means that non-integer numbers are always truncated towards zero. /// diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs index 6ee295de6163f..d4671243f4734 100644 --- a/library/std/src/f32/tests.rs +++ b/library/std/src/f32/tests.rs @@ -209,6 +209,7 @@ fn test_ceil() { #[test] fn test_round() { + assert_approx_eq!(2.5f32.round(), 3.0f32); assert_approx_eq!(1.0f32.round(), 1.0f32); assert_approx_eq!(1.3f32.round(), 1.0f32); assert_approx_eq!(1.5f32.round(), 2.0f32); @@ -221,6 +222,22 @@ fn test_round() { assert_approx_eq!((-1.7f32).round(), -2.0f32); } +#[cfg(not(bootstrap))] +#[test] +fn test_round_ties_even() { + assert_approx_eq!(2.5f32.round_ties_even(), 2.0f32); + assert_approx_eq!(1.0f32.round_ties_even(), 1.0f32); + assert_approx_eq!(1.3f32.round_ties_even(), 1.0f32); + assert_approx_eq!(1.5f32.round_ties_even(), 2.0f32); + assert_approx_eq!(1.7f32.round_ties_even(), 2.0f32); + assert_approx_eq!(0.0f32.round_ties_even(), 0.0f32); + assert_approx_eq!((-0.0f32).round_ties_even(), -0.0f32); + assert_approx_eq!((-1.0f32).round_ties_even(), -1.0f32); + assert_approx_eq!((-1.3f32).round_ties_even(), -1.0f32); + assert_approx_eq!((-1.5f32).round_ties_even(), -2.0f32); + assert_approx_eq!((-1.7f32).round_ties_even(), -2.0f32); +} + #[test] fn test_trunc() { assert_approx_eq!(1.0f32.trunc(), 1.0f32); diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index ec67fdad4f726..85dfb102c7d32 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -78,10 +78,14 @@ impl f64 { /// let f = 3.3_f64; /// let g = -3.3_f64; /// let h = -3.7_f64; + /// let i = 3.5_f64; + /// let j = 4.5_f64; /// /// assert_eq!(f.round(), 3.0); /// assert_eq!(g.round(), -3.0); /// assert_eq!(h.round(), -4.0); + /// assert_eq!(i.round(), 4.0); + /// assert_eq!(j.round(), 5.0); /// ``` #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] @@ -91,6 +95,33 @@ impl f64 { unsafe { intrinsics::roundf64(self) } } + /// Returns the nearest integer to a number. Rounds half-way cases to the number + /// with an even least significant digit. + /// + /// # Examples + /// + /// ``` + /// #![feature(round_ties_even)] + /// + /// let f = 3.3_f64; + /// let g = -3.3_f64; + /// let h = 3.5_f64; + /// let i = 4.5_f64; + /// + /// assert_eq!(f.round_ties_even(), 3.0); + /// assert_eq!(g.round_ties_even(), -3.0); + /// assert_eq!(h.round_ties_even(), 4.0); + /// assert_eq!(i.round_ties_even(), 4.0); + /// ``` + #[cfg(not(bootstrap))] + #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[must_use = "method returns a new number and does not mutate the original value"] + #[unstable(feature = "round_ties_even", issue = "none")] + #[inline] + pub fn round_ties_even(self) -> f64 { + unsafe { intrinsics::roundevenf64(self) } + } + /// Returns the integer part of `self`. /// This means that non-integer numbers are always truncated towards zero. /// diff --git a/library/std/src/f64/tests.rs b/library/std/src/f64/tests.rs index 5b039d445ce14..2f84ff910f5ed 100644 --- a/library/std/src/f64/tests.rs +++ b/library/std/src/f64/tests.rs @@ -199,6 +199,7 @@ fn test_ceil() { #[test] fn test_round() { + assert_approx_eq!(2.5f64.round(), 3.0f64); assert_approx_eq!(1.0f64.round(), 1.0f64); assert_approx_eq!(1.3f64.round(), 1.0f64); assert_approx_eq!(1.5f64.round(), 2.0f64); @@ -211,6 +212,22 @@ fn test_round() { assert_approx_eq!((-1.7f64).round(), -2.0f64); } +#[cfg(not(bootstrap))] +#[test] +fn test_round_ties_even() { + assert_approx_eq!(2.5f64.round_ties_even(), 2.0f64); + assert_approx_eq!(1.0f64.round_ties_even(), 1.0f64); + assert_approx_eq!(1.3f64.round_ties_even(), 1.0f64); + assert_approx_eq!(1.5f64.round_ties_even(), 2.0f64); + assert_approx_eq!(1.7f64.round_ties_even(), 2.0f64); + assert_approx_eq!(0.0f64.round_ties_even(), 0.0f64); + assert_approx_eq!((-0.0f64).round_ties_even(), -0.0f64); + assert_approx_eq!((-1.0f64).round_ties_even(), -1.0f64); + assert_approx_eq!((-1.3f64).round_ties_even(), -1.0f64); + assert_approx_eq!((-1.5f64).round_ties_even(), -2.0f64); + assert_approx_eq!((-1.7f64).round_ties_even(), -2.0f64); +} + #[test] fn test_trunc() { assert_approx_eq!(1.0f64.trunc(), 1.0f64); diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 65d4c3c891ea6..02814d42dd3b8 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -307,6 +307,7 @@ #![feature(provide_any)] #![feature(ptr_as_uninit)] #![feature(raw_os_nonzero)] +#![cfg_attr(not(bootstrap), feature(round_ties_even))] #![feature(slice_internals)] #![feature(slice_ptr_get)] #![feature(std_internals)] From 03c166d3893aba971beecaf65d0722f44a786ecf Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Fri, 8 Jul 2022 21:57:38 -0400 Subject: [PATCH 2/4] Add tracking issue --- library/std/src/f32.rs | 2 +- library/std/src/f64.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index a2c65e0257768..d92eb45e96ce6 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -116,7 +116,7 @@ impl f32 { #[cfg(not(bootstrap))] #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] #[must_use = "method returns a new number and does not mutate the original value"] - #[unstable(feature = "round_ties_even", issue = "none")] + #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] pub fn round_ties_even(self) -> f32 { unsafe { intrinsics::roundevenf32(self) } diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 85dfb102c7d32..2e98495fad30b 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -116,7 +116,7 @@ impl f64 { #[cfg(not(bootstrap))] #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] #[must_use = "method returns a new number and does not mutate the original value"] - #[unstable(feature = "round_ties_even", issue = "none")] + #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] pub fn round_ties_even(self) -> f64 { unsafe { intrinsics::roundevenf64(self) } From f8138110bca50f8eb9196e098d20df5f496b7051 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Mon, 7 Nov 2022 13:10:36 -0500 Subject: [PATCH 3/4] Use rint instead of roundeven Use rint intrinsic instead of roundeven to impement `round_ties_even`. They do the same thing when rounding mode is default, which Rust assumes. And `rint` has better platform support. Keeps `roundeven` around in `core::intrinsics`, it's doing no harm there. --- .../rustc_codegen_cranelift/src/intrinsics/mod.rs | 2 ++ library/core/src/intrinsics.rs | 13 ++++++++----- library/std/src/f32.rs | 2 +- library/std/src/f64.rs | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 4851c3fdcb7a7..ff9447a748460 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -295,6 +295,8 @@ fn codegen_float_intrinsic_call<'tcx>( sym::ceilf64 => ("ceil", 1, fx.tcx.types.f64), sym::truncf32 => ("truncf", 1, fx.tcx.types.f32), sym::truncf64 => ("trunc", 1, fx.tcx.types.f64), + sym::rintf32 => ("rintf", 1, fx.tcx.types.f32), + sym::rintf64 => ("rint", 1, fx.tcx.types.f64), sym::roundf32 => ("roundf", 1, fx.tcx.types.f32), sym::roundf64 => ("round", 1, fx.tcx.types.f64), sym::roundevenf32 => ("roundevenf", 1, fx.tcx.types.f32), diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index e331dfff6fd60..dd84e546a8409 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1588,9 +1588,15 @@ extern "rust-intrinsic" { /// Returns the nearest integer to an `f32`. May raise an inexact floating-point exception /// if the argument is not an integer. + /// + /// The stabilized version of this intrinsic is + /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even) pub fn rintf32(x: f32) -> f32; /// Returns the nearest integer to an `f64`. May raise an inexact floating-point exception /// if the argument is not an integer. + /// + /// The stabilized version of this intrinsic is + /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even) pub fn rintf64(x: f64) -> f64; /// Returns the nearest integer to an `f32`. @@ -1616,16 +1622,13 @@ extern "rust-intrinsic" { /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number /// with an even least significant digit. /// - /// The stabilized version of this intrinsic is - /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even) + /// This intrinsic does not have a stable counterpart. #[cfg(not(bootstrap))] pub fn roundevenf32(x: f32) -> f32; - /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number /// with an even least significant digit. /// - /// The stabilized version of this intrinsic is - /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even) + /// This intrinsic does not have a stable counterpart. #[cfg(not(bootstrap))] pub fn roundevenf64(x: f64) -> f64; diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index d92eb45e96ce6..221ad469de9ba 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -119,7 +119,7 @@ impl f32 { #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] pub fn round_ties_even(self) -> f32 { - unsafe { intrinsics::roundevenf32(self) } + unsafe { intrinsics::rintf32(self) } } /// Returns the integer part of `self`. diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 2e98495fad30b..4663e00f9ed70 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -119,7 +119,7 @@ impl f64 { #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] pub fn round_ties_even(self) -> f64 { - unsafe { intrinsics::roundevenf64(self) } + unsafe { intrinsics::rintf64(self) } } /// Returns the integer part of `self`. From 371d57084d7c2e2dd9b4ac6b5bb9fcc8b0dacd1e Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 8 Nov 2022 20:11:13 -0500 Subject: [PATCH 4/4] Remove some `cfg(not(bootstrap))` --- library/std/src/f32.rs | 3 +-- library/std/src/f32/tests.rs | 1 - library/std/src/f64.rs | 3 +-- library/std/src/f64/tests.rs | 1 - library/std/src/lib.rs | 2 +- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index 221ad469de9ba..dffe3b2d253b3 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -113,8 +113,7 @@ impl f32 { /// assert_eq!(h.round_ties_even(), 4.0); /// assert_eq!(i.round_ties_even(), 4.0); /// ``` - #[cfg(not(bootstrap))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] diff --git a/library/std/src/f32/tests.rs b/library/std/src/f32/tests.rs index d4671243f4734..e949def00bb1f 100644 --- a/library/std/src/f32/tests.rs +++ b/library/std/src/f32/tests.rs @@ -222,7 +222,6 @@ fn test_round() { assert_approx_eq!((-1.7f32).round(), -2.0f32); } -#[cfg(not(bootstrap))] #[test] fn test_round_ties_even() { assert_approx_eq!(2.5f32.round_ties_even(), 2.0f32); diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 4663e00f9ed70..d833dd02d8ef6 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -113,8 +113,7 @@ impl f64 { /// assert_eq!(h.round_ties_even(), 4.0); /// assert_eq!(i.round_ties_even(), 4.0); /// ``` - #[cfg(not(bootstrap))] - #[cfg_attr(not(bootstrap), rustc_allow_incoherent_impl)] + #[rustc_allow_incoherent_impl] #[must_use = "method returns a new number and does not mutate the original value"] #[unstable(feature = "round_ties_even", issue = "96710")] #[inline] diff --git a/library/std/src/f64/tests.rs b/library/std/src/f64/tests.rs index 2f84ff910f5ed..53d351cceef5c 100644 --- a/library/std/src/f64/tests.rs +++ b/library/std/src/f64/tests.rs @@ -212,7 +212,6 @@ fn test_round() { assert_approx_eq!((-1.7f64).round(), -2.0f64); } -#[cfg(not(bootstrap))] #[test] fn test_round_ties_even() { assert_approx_eq!(2.5f64.round_ties_even(), 2.0f64); diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 02814d42dd3b8..dded8adee9a58 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -307,7 +307,7 @@ #![feature(provide_any)] #![feature(ptr_as_uninit)] #![feature(raw_os_nonzero)] -#![cfg_attr(not(bootstrap), feature(round_ties_even))] +#![feature(round_ties_even)] #![feature(slice_internals)] #![feature(slice_ptr_get)] #![feature(std_internals)]