23
23
24
24
use unstable:: intrinsics;
25
25
use cast;
26
+ use std:: kinds:: marker;
26
27
use option:: { Option , Some , None } ;
27
28
use ops:: Drop ;
28
- use util:: NonCopyable ;
29
29
30
30
/**
31
31
* A simple atomic flag, that can be set and cleared. The most basic atomic type.
32
32
*/
33
33
pub struct AtomicFlag {
34
34
priv v: int ,
35
- priv nocopy : NonCopyable
35
+ priv nopod : marker :: NoPod
36
36
}
37
37
38
38
/**
39
39
* An atomic boolean type.
40
40
*/
41
41
pub struct AtomicBool {
42
42
priv v: uint ,
43
- priv nocopy : NonCopyable
43
+ priv nopod : marker :: NoPod
44
44
}
45
45
46
46
/**
47
47
* A signed atomic integer type, supporting basic atomic arithmetic operations
48
48
*/
49
49
pub struct AtomicInt {
50
50
priv v: int ,
51
- priv nocopy : NonCopyable
51
+ priv nopod : marker :: NoPod
52
52
}
53
53
54
54
/**
55
55
* An unsigned atomic integer type, supporting basic atomic arithmetic operations
56
56
*/
57
57
pub struct AtomicUint {
58
58
priv v: uint ,
59
- priv nocopy : NonCopyable
59
+ priv nopod : marker :: NoPod
60
60
}
61
61
62
62
/**
@@ -66,7 +66,7 @@ pub struct AtomicUint {
66
66
#[ cfg( not( stage0) ) ]
67
67
pub struct AtomicU64 {
68
68
priv v: u64 ,
69
- priv nocopy : NonCopyable
69
+ priv nopod : marker :: NoPod
70
70
}
71
71
72
72
/**
@@ -75,12 +75,12 @@ pub struct AtomicU64 {
75
75
#[ cfg( not( stage0) ) ]
76
76
pub struct AtomicPtr < T > {
77
77
priv p: uint ,
78
- priv nocopy : NonCopyable
78
+ priv nopod : marker :: NoPod
79
79
}
80
80
#[ cfg( stage0) ]
81
81
pub struct AtomicPtr < T > {
82
82
priv p: * mut T ,
83
- priv nocopy : NonCopyable
83
+ priv nopod : marker :: NoPod
84
84
}
85
85
86
86
/**
@@ -105,17 +105,17 @@ pub enum Ordering {
105
105
SeqCst
106
106
}
107
107
108
- pub static INIT_ATOMIC_FLAG : AtomicFlag = AtomicFlag { v : 0 , nocopy : NonCopyable } ;
109
- pub static INIT_ATOMIC_BOOL : AtomicBool = AtomicBool { v : 0 , nocopy : NonCopyable } ;
110
- pub static INIT_ATOMIC_INT : AtomicInt = AtomicInt { v : 0 , nocopy : NonCopyable } ;
111
- pub static INIT_ATOMIC_UINT : AtomicUint = AtomicUint { v : 0 , nocopy : NonCopyable } ;
108
+ pub static INIT_ATOMIC_FLAG : AtomicFlag = AtomicFlag { v : 0 , nopod : marker :: NoPod } ;
109
+ pub static INIT_ATOMIC_BOOL : AtomicBool = AtomicBool { v : 0 , nopod : marker :: NoPod } ;
110
+ pub static INIT_ATOMIC_INT : AtomicInt = AtomicInt { v : 0 , nopod : marker :: NoPod } ;
111
+ pub static INIT_ATOMIC_UINT : AtomicUint = AtomicUint { v : 0 , nopod : marker :: NoPod } ;
112
112
#[ cfg( not( stage0) ) ]
113
- pub static INIT_ATOMIC_U64 : AtomicU64 = AtomicU64 { v : 0 , nocopy : NonCopyable } ;
113
+ pub static INIT_ATOMIC_U64 : AtomicU64 = AtomicU64 { v : 0 , nopod : marker :: NoPod } ;
114
114
115
115
impl AtomicFlag {
116
116
117
117
pub fn new ( ) -> AtomicFlag {
118
- AtomicFlag { v : 0 , nocopy : NonCopyable }
118
+ AtomicFlag { v : 0 , nopod : marker :: NoPod }
119
119
}
120
120
121
121
/**
@@ -138,7 +138,7 @@ impl AtomicFlag {
138
138
139
139
impl AtomicBool {
140
140
pub fn new ( v : bool ) -> AtomicBool {
141
- AtomicBool { v : if v { 1 } else { 0 } , nocopy : NonCopyable }
141
+ AtomicBool { v : if v { 1 } else { 0 } , nopod : marker :: NoPod }
142
142
}
143
143
144
144
#[ inline]
@@ -203,7 +203,7 @@ impl AtomicBool {
203
203
204
204
impl AtomicInt {
205
205
pub fn new ( v : int ) -> AtomicInt {
206
- AtomicInt { v : v, nocopy : NonCopyable }
206
+ AtomicInt { v : v, nopod : marker :: NoPod }
207
207
}
208
208
209
209
#[ inline]
@@ -242,7 +242,7 @@ impl AtomicInt {
242
242
#[ cfg( not( stage0) ) ]
243
243
impl AtomicU64 {
244
244
pub fn new ( v : u64 ) -> AtomicU64 {
245
- AtomicU64 { v : v, nocopy : NonCopyable }
245
+ AtomicU64 { v : v, nopod : marker :: NoPod }
246
246
}
247
247
248
248
#[ inline]
@@ -278,7 +278,7 @@ impl AtomicU64 {
278
278
279
279
impl AtomicUint {
280
280
pub fn new ( v : uint ) -> AtomicUint {
281
- AtomicUint { v : v, nocopy : NonCopyable }
281
+ AtomicUint { v : v, nopod : marker :: NoPod }
282
282
}
283
283
284
284
#[ inline]
@@ -317,11 +317,11 @@ impl AtomicUint {
317
317
impl < T > AtomicPtr < T > {
318
318
#[ cfg( stage0) ]
319
319
pub fn new ( p : * mut T ) -> AtomicPtr < T > {
320
- AtomicPtr { p : p, nocopy : NonCopyable }
320
+ AtomicPtr { p : p, nopod : marker :: NoPod }
321
321
}
322
322
#[ cfg( not( stage0) ) ]
323
323
pub fn new ( p : * mut T ) -> AtomicPtr < T > {
324
- AtomicPtr { p : p as uint , nocopy : NonCopyable }
324
+ AtomicPtr { p : p as uint , nopod : marker :: NoPod }
325
325
}
326
326
327
327
#[ inline]
0 commit comments