2012-12-10 17:44:02 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-11-30 03:31:56 -06:00
|
|
|
/*!
|
|
|
|
The kind traits
|
2012-11-30 02:47:45 -06:00
|
|
|
|
2012-11-30 14:39:44 -06:00
|
|
|
Rust types can be classified in various useful ways according to
|
2012-11-30 03:31:56 -06:00
|
|
|
intrinsic properties of the type. These classifications, often called
|
|
|
|
'kinds', are represented as traits.
|
|
|
|
|
|
|
|
They cannot be implemented by user code, but are instead implemented
|
|
|
|
by the compiler automatically for the types to which they apply.
|
|
|
|
|
2013-07-10 16:43:25 -05:00
|
|
|
The 2 kinds are
|
2012-11-30 03:31:56 -06:00
|
|
|
|
2013-06-05 19:56:24 -05:00
|
|
|
* Send - owned types and types containing owned types. These types
|
2012-11-30 03:31:56 -06:00
|
|
|
may be transferred across task boundaries.
|
|
|
|
|
2013-06-05 16:52:27 -05:00
|
|
|
* Freeze - types that are deeply immutable.
|
2012-11-30 03:31:56 -06:00
|
|
|
|
|
|
|
*/
|
2012-11-30 02:47:45 -06:00
|
|
|
|
2013-05-28 16:35:52 -05:00
|
|
|
#[allow(missing_doc)];
|
|
|
|
|
2013-07-10 19:31:53 -05:00
|
|
|
#[cfg(stage0)]
|
2012-11-30 02:47:45 -06:00
|
|
|
#[lang="copy"]
|
|
|
|
pub trait Copy {
|
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
2013-06-05 13:33:14 -05:00
|
|
|
#[cfg(stage0)]
|
2012-12-11 15:50:04 -06:00
|
|
|
#[lang="owned"]
|
2013-06-05 19:56:24 -05:00
|
|
|
pub trait Send {
|
2013-06-05 13:33:14 -05:00
|
|
|
// empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(stage0))]
|
|
|
|
#[lang="send"]
|
2013-06-05 19:56:24 -05:00
|
|
|
pub trait Send {
|
2013-06-05 13:33:14 -05:00
|
|
|
// empty.
|
2012-11-30 02:47:45 -06:00
|
|
|
}
|
|
|
|
|
2013-06-05 16:52:27 -05:00
|
|
|
#[cfg(stage0)]
|
2012-11-30 03:31:56 -06:00
|
|
|
#[lang="const"]
|
2013-06-05 17:53:17 -05:00
|
|
|
pub trait Freeze {
|
2013-06-05 16:52:27 -05:00
|
|
|
// empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(stage0))]
|
|
|
|
#[lang="freeze"]
|
2013-06-05 17:53:17 -05:00
|
|
|
pub trait Freeze {
|
2013-06-05 16:52:27 -05:00
|
|
|
// empty.
|
2012-11-30 03:31:56 -06:00
|
|
|
}
|
2013-05-30 19:03:01 -05:00
|
|
|
|
|
|
|
#[lang="sized"]
|
|
|
|
pub trait Sized {
|
|
|
|
// Empty.
|
|
|
|
}
|