File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ use marker::Sync;
76
76
77
77
use intrinsics;
78
78
use cell:: UnsafeCell ;
79
+ use marker:: PhantomData ;
79
80
80
81
/// A boolean type which can be safely shared between threads.
81
82
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -105,6 +106,7 @@ unsafe impl Sync for AtomicUsize {}
105
106
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
106
107
pub struct AtomicPtr < T > {
107
108
p : UnsafeCell < usize > ,
109
+ _marker : PhantomData < * mut T > ,
108
110
}
109
111
110
112
unsafe impl < T > Sync for AtomicPtr < T > { }
@@ -791,7 +793,8 @@ impl<T> AtomicPtr<T> {
791
793
#[ inline]
792
794
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
793
795
pub fn new ( p : * mut T ) -> AtomicPtr < T > {
794
- AtomicPtr { p : UnsafeCell :: new ( p as usize ) }
796
+ AtomicPtr { p : UnsafeCell :: new ( p as usize ) ,
797
+ _marker : PhantomData }
795
798
}
796
799
797
800
/// Loads a value from the pointer.
You can’t perform that action at this time.
0 commit comments