Skip to content

Commit 1d7a731

Browse files
committed
Stabilize AtomicN::fetch_min and AtomicN::fetch_max
1 parent d4bf056 commit 1d7a731

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/libcore/sync/atomic.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,6 @@ using [`Release`] makes the load part [`Relaxed`].
18821882
# Examples
18831883
18841884
```
1885-
#![feature(atomic_min_max)]
18861885
", $extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};
18871886
18881887
let foo = ", stringify!($atomic_type), "::new(23);
@@ -1893,7 +1892,6 @@ assert_eq!(foo.load(Ordering::SeqCst), 42);
18931892
If you want to obtain the maximum value in one step, you can use the following:
18941893
18951894
```
1896-
#![feature(atomic_min_max)]
18971895
", $extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};
18981896
18991897
let foo = ", stringify!($atomic_type), "::new(23);
@@ -1902,9 +1900,7 @@ let max_foo = foo.fetch_max(bar, Ordering::SeqCst).max(bar);
19021900
assert!(max_foo == 42);
19031901
```"),
19041902
#[inline]
1905-
#[unstable(feature = "atomic_min_max",
1906-
reason = "easier and faster min/max than writing manual CAS loop",
1907-
issue = "48655")]
1903+
#[stable(feature = "atomic_min_max", since = "1.45.0")]
19081904
#[$cfg_cas]
19091905
pub fn fetch_max(&self, val: $int_type, order: Ordering) -> $int_type {
19101906
// SAFETY: data races are prevented by atomic intrinsics.
@@ -1933,7 +1929,6 @@ using [`Release`] makes the load part [`Relaxed`].
19331929
# Examples
19341930
19351931
```
1936-
#![feature(atomic_min_max)]
19371932
", $extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};
19381933
19391934
let foo = ", stringify!($atomic_type), "::new(23);
@@ -1946,7 +1941,6 @@ assert_eq!(foo.load(Ordering::Relaxed), 22);
19461941
If you want to obtain the minimum value in one step, you can use the following:
19471942
19481943
```
1949-
#![feature(atomic_min_max)]
19501944
", $extra_feature, "use std::sync::atomic::{", stringify!($atomic_type), ", Ordering};
19511945
19521946
let foo = ", stringify!($atomic_type), "::new(23);
@@ -1955,9 +1949,7 @@ let min_foo = foo.fetch_min(bar, Ordering::SeqCst).min(bar);
19551949
assert_eq!(min_foo, 12);
19561950
```"),
19571951
#[inline]
1958-
#[unstable(feature = "atomic_min_max",
1959-
reason = "easier and faster min/max than writing manual CAS loop",
1960-
issue = "48655")]
1952+
#[stable(feature = "atomic_min_max", since = "1.45.0")]
19611953
#[$cfg_cas]
19621954
pub fn fetch_min(&self, val: $int_type, order: Ordering) -> $int_type {
19631955
// SAFETY: data races are prevented by atomic intrinsics.

0 commit comments

Comments
 (0)