diff options
| author | bors <bors@rust-lang.org> | 2020-11-22 10:50:04 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-22 10:50:04 +0000 |
| commit | 5d5ff84130da0d74c6ece368dbe821d8f83fa526 (patch) | |
| tree | 455369fca4472369b4aed5cca90ec7000164e319 /library/std/src | |
| parent | 20328b532336017213ccb4095740955d81060ebc (diff) | |
| parent | fb6ceac46b0b3ecd8220dee17a257e2655f6a66a (diff) | |
| download | rust-5d5ff84130da0d74c6ece368dbe821d8f83fa526.tar.gz rust-5d5ff84130da0d74c6ece368dbe821d8f83fa526.zip | |
Auto merge of #77872 - Xaeroxe:stabilize-clamp, r=scottmcm
Stabilize clamp Tracking issue: https://github.com/rust-lang/rust/issues/44095 Clamp has been merged and unstable for about a year and a half now. How do we feel about stabilizing this?
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/f32.rs | 3 | ||||
| -rw-r--r-- | library/std/src/f64.rs | 3 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 |
3 files changed, 2 insertions, 5 deletions
diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index 2a54b117ff4..09a9b184e3a 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -893,14 +893,13 @@ impl f32 { /// # Examples /// /// ``` - /// #![feature(clamp)] /// assert!((-3.0f32).clamp(-2.0, 1.0) == -2.0); /// assert!((0.0f32).clamp(-2.0, 1.0) == 0.0); /// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0); /// assert!((f32::NAN).clamp(-2.0, 1.0).is_nan()); /// ``` #[must_use = "method returns a new number and does not mutate the original value"] - #[unstable(feature = "clamp", issue = "44095")] + #[stable(feature = "clamp", since = "1.50.0")] #[inline] pub fn clamp(self, min: f32, max: f32) -> f32 { assert!(min <= max); diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 363d1a00476..64bb7cd9fd1 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -895,14 +895,13 @@ impl f64 { /// # Examples /// /// ``` - /// #![feature(clamp)] /// assert!((-3.0f64).clamp(-2.0, 1.0) == -2.0); /// assert!((0.0f64).clamp(-2.0, 1.0) == 0.0); /// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0); /// assert!((f64::NAN).clamp(-2.0, 1.0).is_nan()); /// ``` #[must_use = "method returns a new number and does not mutate the original value"] - #[unstable(feature = "clamp", issue = "44095")] + #[stable(feature = "clamp", since = "1.50.0")] #[inline] pub fn clamp(self, min: f64, max: f64) -> f64 { assert!(min <= max); diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index db523f05e01..d2f36309e2d 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -235,7 +235,6 @@ #![feature(cfg_target_thread_local)] #![feature(char_error_internals)] #![feature(char_internals)] -#![feature(clamp)] #![feature(concat_idents)] #![feature(const_cstr_unchecked)] #![feature(const_fn_floating_point_arithmetic)] |
