Skip to content

Commit 37523c1

Browse files
committed
Unnecessitate #![feature(const_fn)]
1 parent 97dc28c commit 37523c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
//! into `const fn`, making it callable in constant contexts.
7979
//!
8080
#![no_std]
81-
#![cfg_attr(feature = "nightly", feature(const_fn))]
8281
#![cfg_attr(feature = "nightly", feature(const_if_match))]
8382

8483
use core::sync::atomic::{AtomicPtr, Ordering};
@@ -92,9 +91,13 @@ use core::default::Default;
9291
pub struct AtomicRef<'a, T: 'a> {
9392
data: AtomicPtr<T>,
9493
// Make `AtomicRef` invariant over `'a` and `T`
95-
_marker: PhantomData<&'a mut &'a mut T>,
94+
_marker: PhantomData<Invariant<'a, T>>,
9695
}
9796

97+
// Work-around for the construction of `PhantomData<&mut _>` requiring
98+
// `#![feature(const_fn)]`
99+
struct Invariant<'a, T: 'a>(&'a mut &'a mut T);
100+
98101
/// You will probably never need to use this type. It exists mostly for internal
99102
/// use in the `static_atomic_ref!` macro.
100103
///

0 commit comments

Comments
 (0)