Skip to content

Commit ba2a77b

Browse files
committed
stabilisation
1 parent 5037097 commit ba2a77b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/libcore/markers.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,21 @@ use clone::Clone;
2929

3030

3131
/// Types able to be transferred across task boundaries.
32+
#[unstable = "will be overhauled with new lifetime rules; see RFC 458"]
3233
#[lang="send"]
3334
pub unsafe trait Send: 'static {
3435
// empty.
3536
}
3637

3738
/// Types with a constant size known at compile-time.
39+
#[stable]
3840
#[lang="sized"]
3941
pub trait Sized {
4042
// Empty.
4143
}
4244

4345
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
46+
#[stable]
4447
#[lang="copy"]
4548
pub trait Copy {
4649
// Empty.
@@ -91,6 +94,7 @@ pub trait Copy {
9194
/// around the value(s) which can be mutated when behind a `&`
9295
/// reference; not doing this is undefined behaviour (for example,
9396
/// `transmute`-ing from `&T` to `&mut T` is illegal).
97+
#[unstable = "will be overhauled with new lifetime rules; see RFC 458"]
9498
#[lang="sync"]
9599
pub unsafe trait Sync {
96100
// Empty
@@ -134,6 +138,7 @@ pub unsafe trait Sync {
134138
/// `S<T>` is a subtype of `S<U>` if `T` is a subtype of `U`
135139
/// (for example, `S<&'static int>` is a subtype of `S<&'a int>`
136140
/// for some lifetime `'a`, but not the other way around).
141+
#[unstable = "likely to change with new variance strategy"]
137142
#[lang="covariant_type"]
138143
#[derive(PartialEq, Eq, PartialOrd, Ord)]
139144
pub struct CovariantType<Sized? T>;
@@ -182,6 +187,7 @@ impl<Sized? T> Clone for CovariantType<T> {
182187
/// subtype of `S<U>` if `U` is a subtype of `T`; given that the
183188
/// function requires arguments of type `T`, it must also accept
184189
/// arguments of type `U`, hence such a conversion is safe.
190+
#[unstable = "likely to change with new variance strategy"]
185191
#[lang="contravariant_type"]
186192
#[derive(PartialEq, Eq, PartialOrd, Ord)]
187193
pub struct ContravariantType<T: ?Sized>;
@@ -212,11 +218,14 @@ impl<T: ?Sized> Clone for ContravariantType<T> {
212218
/// The type system would infer that `value` is only read here and
213219
/// never written, but in fact `Cell` uses unsafe code to achieve
214220
/// interior mutability.
221+
#[unstable = "likely to change with new variance strategy"]
215222
#[lang="invariant_type"]
216223
#[derive(PartialEq, Eq, PartialOrd, Ord)]
217224
pub struct InvariantType<T: ?Sized>;
218225

226+
#[unstable = "likely to change with new variance strategy"]
219227
impl<T: ?Sized> Copy for InvariantType<T> {}
228+
#[unstable = "likely to change with new variance strategy"]
220229
impl<T: ?Sized> Clone for InvariantType<T> {
221230
fn clone(&self) -> InvariantType<T> { *self }
222231
}
@@ -237,6 +246,7 @@ impl<T: ?Sized> Clone for InvariantType<T> {
237246
///
238247
/// For more information about variance, refer to this Wikipedia
239248
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
249+
#[unstable = "likely to change with new variance strategy"]
240250
#[lang="covariant_lifetime"]
241251
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
242252
pub struct CovariantLifetime<'a>;
@@ -253,6 +263,7 @@ pub struct CovariantLifetime<'a>;
253263
///
254264
/// For more information about variance, refer to this Wikipedia
255265
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
266+
#[unstable = "likely to change with new variance strategy"]
256267
#[lang="contravariant_lifetime"]
257268
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
258269
pub struct ContravariantLifetime<'a>;
@@ -264,6 +275,7 @@ pub struct ContravariantLifetime<'a>;
264275
/// pointer that is actually a pointer into memory with lifetime `'a`,
265276
/// and this pointer is itself stored in an inherently mutable
266277
/// location (such as a `Cell`).
278+
#[unstable = "likely to change with new variance strategy"]
267279
#[lang="invariant_lifetime"]
268280
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
269281
pub struct InvariantLifetime<'a>;
@@ -272,13 +284,15 @@ pub struct InvariantLifetime<'a>;
272284
/// be safely sent between tasks, even if it is owned. This is
273285
/// typically embedded in other types, such as `Gc`, to ensure that
274286
/// their instances remain thread-local.
287+
#[unstable = "likely to change with new variance strategy"]
275288
#[lang="no_send_bound"]
276289
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
277290
pub struct NoSend;
278291

279292
/// A type which is considered "not POD", meaning that it is not
280293
/// implicitly copyable. This is typically embedded in other types to
281294
/// ensure that they are never copied, even if they lack a destructor.
295+
#[unstable = "likely to change with new variance strategy"]
282296
#[lang="no_copy_bound"]
283297
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
284298
#[allow(missing_copy_implementations)]
@@ -287,12 +301,14 @@ pub struct NoCopy;
287301
/// A type which is considered "not sync", meaning that
288302
/// its contents are not threadsafe, hence they cannot be
289303
/// shared between tasks.
304+
#[unstable = "likely to change with new variance strategy"]
290305
#[lang="no_sync_bound"]
291306
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
292307
pub struct NoSync;
293308

294309
/// A type which is considered managed by the GC. This is typically
295310
/// embedded in other types.
311+
#[unstable = "likely to change with new variance strategy"]
296312
#[lang="managed_bound"]
297313
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
298314
#[allow(missing_copy_implementations)]

0 commit comments

Comments
 (0)