Skip to content

Commit 5d5ff84

Browse files
committed
Auto merge of #77872 - Xaeroxe:stabilize-clamp, r=scottmcm
Stabilize clamp Tracking issue: #44095 Clamp has been merged and unstable for about a year and a half now. How do we feel about stabilizing this?
2 parents 20328b5 + fb6ceac commit 5d5ff84

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

library/core/src/cmp.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -641,14 +641,12 @@ pub trait Ord: Eq + PartialOrd<Self> {
641641
/// # Examples
642642
///
643643
/// ```
644-
/// #![feature(clamp)]
645-
///
646644
/// assert!((-3).clamp(-2, 1) == -2);
647645
/// assert!(0.clamp(-2, 1) == 0);
648646
/// assert!(2.clamp(-2, 1) == 1);
649647
/// ```
650648
#[must_use]
651-
#[unstable(feature = "clamp", issue = "44095")]
649+
#[stable(feature = "clamp", since = "1.50.0")]
652650
fn clamp(self, min: Self, max: Self) -> Self
653651
where
654652
Self: Sized,

library/std/src/f32.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,13 @@ impl f32 {
893893
/// # Examples
894894
///
895895
/// ```
896-
/// #![feature(clamp)]
897896
/// assert!((-3.0f32).clamp(-2.0, 1.0) == -2.0);
898897
/// assert!((0.0f32).clamp(-2.0, 1.0) == 0.0);
899898
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
900899
/// assert!((f32::NAN).clamp(-2.0, 1.0).is_nan());
901900
/// ```
902901
#[must_use = "method returns a new number and does not mutate the original value"]
903-
#[unstable(feature = "clamp", issue = "44095")]
902+
#[stable(feature = "clamp", since = "1.50.0")]
904903
#[inline]
905904
pub fn clamp(self, min: f32, max: f32) -> f32 {
906905
assert!(min <= max);

library/std/src/f64.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -895,14 +895,13 @@ impl f64 {
895895
/// # Examples
896896
///
897897
/// ```
898-
/// #![feature(clamp)]
899898
/// assert!((-3.0f64).clamp(-2.0, 1.0) == -2.0);
900899
/// assert!((0.0f64).clamp(-2.0, 1.0) == 0.0);
901900
/// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
902901
/// assert!((f64::NAN).clamp(-2.0, 1.0).is_nan());
903902
/// ```
904903
#[must_use = "method returns a new number and does not mutate the original value"]
905-
#[unstable(feature = "clamp", issue = "44095")]
904+
#[stable(feature = "clamp", since = "1.50.0")]
906905
#[inline]
907906
pub fn clamp(self, min: f64, max: f64) -> f64 {
908907
assert!(min <= max);

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@
235235
#![feature(cfg_target_thread_local)]
236236
#![feature(char_error_internals)]
237237
#![feature(char_internals)]
238-
#![feature(clamp)]
239238
#![feature(concat_idents)]
240239
#![feature(const_cstr_unchecked)]
241240
#![feature(const_fn_floating_point_arithmetic)]

0 commit comments

Comments
 (0)