@@ -29,18 +29,21 @@ use clone::Clone;
29
29
30
30
31
31
/// Types able to be transferred across task boundaries.
32
+ #[ unstable = "will be overhauled with new lifetime rules; see RFC 458" ]
32
33
#[ lang="send" ]
33
34
pub unsafe trait Send : ' static {
34
35
// empty.
35
36
}
36
37
37
38
/// Types with a constant size known at compile-time.
39
+ #[ stable]
38
40
#[ lang="sized" ]
39
41
pub trait Sized {
40
42
// Empty.
41
43
}
42
44
43
45
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
46
+ #[ stable]
44
47
#[ lang="copy" ]
45
48
pub trait Copy {
46
49
// Empty.
@@ -91,6 +94,7 @@ pub trait Copy {
91
94
/// around the value(s) which can be mutated when behind a `&`
92
95
/// reference; not doing this is undefined behaviour (for example,
93
96
/// `transmute`-ing from `&T` to `&mut T` is illegal).
97
+ #[ unstable = "will be overhauled with new lifetime rules; see RFC 458" ]
94
98
#[ lang="sync" ]
95
99
pub unsafe trait Sync {
96
100
// Empty
@@ -134,6 +138,7 @@ pub unsafe trait Sync {
134
138
/// `S<T>` is a subtype of `S<U>` if `T` is a subtype of `U`
135
139
/// (for example, `S<&'static int>` is a subtype of `S<&'a int>`
136
140
/// for some lifetime `'a`, but not the other way around).
141
+ #[ unstable = "likely to change with new variance strategy" ]
137
142
#[ lang="covariant_type" ]
138
143
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
139
144
pub struct CovariantType < Sized ? T > ;
@@ -182,6 +187,7 @@ impl<Sized? T> Clone for CovariantType<T> {
182
187
/// subtype of `S<U>` if `U` is a subtype of `T`; given that the
183
188
/// function requires arguments of type `T`, it must also accept
184
189
/// arguments of type `U`, hence such a conversion is safe.
190
+ #[ unstable = "likely to change with new variance strategy" ]
185
191
#[ lang="contravariant_type" ]
186
192
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
187
193
pub struct ContravariantType < T : ?Sized > ;
@@ -212,11 +218,14 @@ impl<T: ?Sized> Clone for ContravariantType<T> {
212
218
/// The type system would infer that `value` is only read here and
213
219
/// never written, but in fact `Cell` uses unsafe code to achieve
214
220
/// interior mutability.
221
+ #[ unstable = "likely to change with new variance strategy" ]
215
222
#[ lang="invariant_type" ]
216
223
#[ derive( PartialEq , Eq , PartialOrd , Ord ) ]
217
224
pub struct InvariantType < T : ?Sized > ;
218
225
226
+ #[ unstable = "likely to change with new variance strategy" ]
219
227
impl < T : ?Sized > Copy for InvariantType < T > { }
228
+ #[ unstable = "likely to change with new variance strategy" ]
220
229
impl < T : ?Sized > Clone for InvariantType < T > {
221
230
fn clone ( & self ) -> InvariantType < T > { * self }
222
231
}
@@ -237,6 +246,7 @@ impl<T: ?Sized> Clone for InvariantType<T> {
237
246
///
238
247
/// For more information about variance, refer to this Wikipedia
239
248
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
249
+ #[ unstable = "likely to change with new variance strategy" ]
240
250
#[ lang="covariant_lifetime" ]
241
251
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
242
252
pub struct CovariantLifetime < ' a > ;
@@ -253,6 +263,7 @@ pub struct CovariantLifetime<'a>;
253
263
///
254
264
/// For more information about variance, refer to this Wikipedia
255
265
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
266
+ #[ unstable = "likely to change with new variance strategy" ]
256
267
#[ lang="contravariant_lifetime" ]
257
268
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
258
269
pub struct ContravariantLifetime < ' a > ;
@@ -264,6 +275,7 @@ pub struct ContravariantLifetime<'a>;
264
275
/// pointer that is actually a pointer into memory with lifetime `'a`,
265
276
/// and this pointer is itself stored in an inherently mutable
266
277
/// location (such as a `Cell`).
278
+ #[ unstable = "likely to change with new variance strategy" ]
267
279
#[ lang="invariant_lifetime" ]
268
280
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
269
281
pub struct InvariantLifetime < ' a > ;
@@ -272,13 +284,15 @@ pub struct InvariantLifetime<'a>;
272
284
/// be safely sent between tasks, even if it is owned. This is
273
285
/// typically embedded in other types, such as `Gc`, to ensure that
274
286
/// their instances remain thread-local.
287
+ #[ unstable = "likely to change with new variance strategy" ]
275
288
#[ lang="no_send_bound" ]
276
289
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
277
290
pub struct NoSend ;
278
291
279
292
/// A type which is considered "not POD", meaning that it is not
280
293
/// implicitly copyable. This is typically embedded in other types to
281
294
/// ensure that they are never copied, even if they lack a destructor.
295
+ #[ unstable = "likely to change with new variance strategy" ]
282
296
#[ lang="no_copy_bound" ]
283
297
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord ) ]
284
298
#[ allow( missing_copy_implementations) ]
@@ -287,12 +301,14 @@ pub struct NoCopy;
287
301
/// A type which is considered "not sync", meaning that
288
302
/// its contents are not threadsafe, hence they cannot be
289
303
/// shared between tasks.
304
+ #[ unstable = "likely to change with new variance strategy" ]
290
305
#[ lang="no_sync_bound" ]
291
306
#[ derive( Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
292
307
pub struct NoSync ;
293
308
294
309
/// A type which is considered managed by the GC. This is typically
295
310
/// embedded in other types.
311
+ #[ unstable = "likely to change with new variance strategy" ]
296
312
#[ lang="managed_bound" ]
297
313
#[ derive( Clone , PartialEq , Eq , PartialOrd , Ord ) ]
298
314
#[ allow( missing_copy_implementations) ]
0 commit comments