File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 78
78
//! into `const fn`, making it callable in constant contexts.
79
79
//!
80
80
#![ no_std]
81
- #![ cfg_attr( feature = "nightly" , feature( const_fn) ) ]
82
81
#![ cfg_attr( feature = "nightly" , feature( const_if_match) ) ]
83
82
84
83
use core:: sync:: atomic:: { AtomicPtr , Ordering } ;
@@ -92,9 +91,13 @@ use core::default::Default;
92
91
pub struct AtomicRef < ' a , T : ' a > {
93
92
data : AtomicPtr < T > ,
94
93
// Make `AtomicRef` invariant over `'a` and `T`
95
- _marker : PhantomData < & ' a mut & ' a mut T > ,
94
+ _marker : PhantomData < Invariant < ' a , T > > ,
96
95
}
97
96
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
+
98
101
/// You will probably never need to use this type. It exists mostly for internal
99
102
/// use in the `static_atomic_ref!` macro.
100
103
///
You can’t perform that action at this time.
0 commit comments