Skip to content

Commit a7d3368

Browse files
committed
Stabilize clamp
1 parent d6b5ffb commit a7d3368

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
@@ -631,14 +631,12 @@ pub trait Ord: Eq + PartialOrd<Self> {
631631
/// # Examples
632632
///
633633
/// ```
634-
/// #![feature(clamp)]
635-
///
636634
/// assert!((-3).clamp(-2, 1) == -2);
637635
/// assert!(0.clamp(-2, 1) == 0);
638636
/// assert!(2.clamp(-2, 1) == 1);
639637
/// ```
640638
#[must_use]
641-
#[unstable(feature = "clamp", issue = "44095")]
639+
#[stable(feature = "clamp", since = "1.49.0")]
642640
fn clamp(self, min: Self, max: Self) -> Self
643641
where
644642
Self: Sized,

library/std/src/f32.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -891,14 +891,13 @@ impl f32 {
891891
/// # Examples
892892
///
893893
/// ```
894-
/// #![feature(clamp)]
895894
/// assert!((-3.0f32).clamp(-2.0, 1.0) == -2.0);
896895
/// assert!((0.0f32).clamp(-2.0, 1.0) == 0.0);
897896
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
898897
/// assert!((f32::NAN).clamp(-2.0, 1.0).is_nan());
899898
/// ```
900899
#[must_use = "method returns a new number and does not mutate the original value"]
901-
#[unstable(feature = "clamp", issue = "44095")]
900+
#[stable(feature = "clamp", since = "1.49.0")]
902901
#[inline]
903902
pub fn clamp(self, min: f32, max: f32) -> f32 {
904903
assert!(min <= max);

library/std/src/f64.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,13 @@ impl f64 {
893893
/// # Examples
894894
///
895895
/// ```
896-
/// #![feature(clamp)]
897896
/// assert!((-3.0f64).clamp(-2.0, 1.0) == -2.0);
898897
/// assert!((0.0f64).clamp(-2.0, 1.0) == 0.0);
899898
/// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
900899
/// assert!((f64::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.49.0")]
904903
#[inline]
905904
pub fn clamp(self, min: f64, max: f64) -> f64 {
906905
assert!(min <= max);

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@
234234
#![feature(cfg_target_thread_local)]
235235
#![feature(char_error_internals)]
236236
#![feature(char_internals)]
237-
#![feature(clamp)]
238237
#![feature(concat_idents)]
239238
#![feature(const_cstr_unchecked)]
240239
#![feature(const_fn_floating_point_arithmetic)]

0 commit comments

Comments
 (0)