2012-07-25 19:03:55 -07:00
|
|
|
// Core operators and kinds.
|
|
|
|
|
2012-10-03 14:52:09 -07:00
|
|
|
#[forbid(deprecated_mode)];
|
|
|
|
#[forbid(deprecated_pattern)];
|
|
|
|
|
2012-07-25 19:03:55 -07:00
|
|
|
#[lang="const"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Const {
|
2012-07-25 19:03:55 -07:00
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="copy"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Copy {
|
2012-07-25 19:03:55 -07:00
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="send"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Send {
|
2012-07-25 19:03:55 -07:00
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="owned"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Owned {
|
2012-07-25 19:03:55 -07:00
|
|
|
// Empty.
|
|
|
|
}
|
|
|
|
|
2012-11-05 17:50:01 -08:00
|
|
|
#[lang="drop"]
|
|
|
|
pub trait Drop {
|
2012-11-28 15:42:16 -08:00
|
|
|
fn finalize(&self); // XXX: Rename to "drop"? --pcwalton
|
2012-11-05 17:50:01 -08:00
|
|
|
}
|
|
|
|
|
2012-09-19 18:00:26 -07:00
|
|
|
#[lang="add"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Add<RHS,Result> {
|
2012-09-19 18:00:26 -07:00
|
|
|
pure fn add(rhs: &RHS) -> Result;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="sub"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Sub<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn sub(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="mul"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Mul<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn mul(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="div"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Div<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn div(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="modulo"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Modulo<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn modulo(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
2012-07-25 19:03:55 -07:00
|
|
|
#[lang="neg"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Neg<Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn neg(&self) -> Result;
|
2012-07-25 19:03:55 -07:00
|
|
|
}
|
|
|
|
|
2012-09-19 18:00:26 -07:00
|
|
|
#[lang="bitand"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait BitAnd<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn bitand(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="bitor"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait BitOr<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn bitor(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="bitxor"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait BitXor<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn bitxor(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="shl"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Shl<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn shl(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#[lang="shr"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Shr<RHS,Result> {
|
2012-11-21 12:25:35 -08:00
|
|
|
pure fn shr(&self, rhs: &RHS) -> Result;
|
2012-09-19 18:00:26 -07:00
|
|
|
}
|
|
|
|
|
2012-07-25 19:03:55 -07:00
|
|
|
#[lang="index"]
|
2012-09-28 12:30:11 -07:00
|
|
|
pub trait Index<Index,Result> {
|
2012-10-02 11:37:37 -07:00
|
|
|
pure fn index(index: Index) -> Result;
|
2012-07-25 19:03:55 -07:00
|
|
|
}
|
|
|
|
|