Skip to content

Commit 2693e2c

Browse files
committed
Remove redundant nightly feature for fetch_min, fetch_max and fetch_update
See also rust-lang/rust#48655 (comment)
1 parent ce5148e commit 2693e2c

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Traits over atomic primitive integer types.
88

99
## Notes
1010

11-
* Enable feature `nightly` to get `min`, `max`, `fetch_update` and
12-
`as_mut_ptr` when you have a nightly compiler available.
11+
* Enable feature `nightly` to get `as_mut_ptr` when you have a nightly compiler available.
12+
* Rust 1.45.0 or newer is required
1313

1414
## Copyright and License
1515

src/lib.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(feature = "nightly", feature(atomic_min_max, atomic_mut_ptr, no_more_cas))]
1+
#![cfg_attr(feature = "nightly", feature(atomic_mut_ptr))]
22
use std::sync::atomic::{self, Ordering};
33
use std::hash::Hash;
44
use std::fmt::{Debug, Display};
@@ -64,18 +64,15 @@ pub trait AtomicInt : Default + Send + Sync + RefUnwindSafe + UnwindSafe {
6464
ordering: Ordering
6565
) -> <Self as AtomicInt>::Prim;
6666

67-
#[cfg(feature="nightly")]
6867
fn fetch_min(&self, val: <Self as AtomicInt>::Prim, order: Ordering) -> <Self as AtomicInt>::Prim;
6968

70-
#[cfg(feature="nightly")]
7169
fn fetch_max(&self, val: <Self as AtomicInt>::Prim, order: Ordering) -> <Self as AtomicInt>::Prim;
7270

73-
#[cfg(feature="nightly")]
7471
fn fetch_update<F>(
7572
&self,
76-
f: F,
73+
set_order: Ordering,
7774
fetch_order: Ordering,
78-
set_order: Ordering
75+
f: F
7976
) -> Result<<Self as AtomicInt>::Prim, <Self as AtomicInt>::Prim>
8077
where F: FnMut(<Self as AtomicInt>::Prim) -> Option<<Self as AtomicInt>::Prim>;
8178

@@ -173,7 +170,6 @@ macro_rules! impl_atomic_int {
173170
self.fetch_xor(new, ordering)
174171
}
175172

176-
#[cfg(feature = "nightly")]
177173
fn fetch_min(
178174
&self,
179175
val: $prim,
@@ -182,7 +178,6 @@ macro_rules! impl_atomic_int {
182178
self.fetch_min(val, ordering)
183179
}
184180

185-
#[cfg(feature = "nightly")]
186181
fn fetch_max(
187182
&self,
188183
val: $prim,
@@ -191,17 +186,16 @@ macro_rules! impl_atomic_int {
191186
self.fetch_max(val, ordering)
192187
}
193188

194-
#[cfg(feature = "nightly")]
195189
fn fetch_update<F>(
196190
&self,
197-
f: F,
198-
fetch_order: Ordering,
199191
set_order: Ordering,
192+
fetch_order: Ordering,
193+
mut f: F,
200194
) -> Result<$prim, $prim>
201195
where
202196
F: FnMut($prim) -> Option<$prim>,
203197
{
204-
self.fetch_update(f, fetch_order, set_order)
198+
self.fetch_update(set_order, fetch_order, f)
205199
}
206200

207201
fn get_mut(&mut self) -> &mut $prim {

0 commit comments

Comments
 (0)