add more built-in traits to dox.rs
diff --git a/src/dox.rs b/src/dox.rs
index 941b65c..4b03a5a 100644
--- a/src/dox.rs
+++ b/src/dox.rs
@@ -91,12 +91,39 @@
fn sub(self, rhs: RHS) -> Self::Output;
}
+ #[lang = "bitand"]
+ pub trait BitAnd<RHS=Self> {
+ type Output;
+ fn bitand(self, rhs: RHS) -> Self::Output;
+ }
+
+ #[lang = "bitand_assign"]
+ pub trait BitAndAssign<RHS = Self> {
+ fn bitand_assign(&mut self, rhs: RHS);
+ }
+
#[lang = "bitor"]
- pub trait Bitor<RHS=Self> {
+ pub trait BitOr<RHS=Self> {
type Output;
fn bitor(self, rhs: RHS) -> Self::Output;
}
+ #[lang = "bitor_assign"]
+ pub trait BitOrAssign<RHS = Self> {
+ fn bitor_assign(&mut self, rhs: RHS);
+ }
+
+ #[lang = "bitxor"]
+ pub trait BitXor<RHS=Self> {
+ type Output;
+ fn bitxor(self, rhs: RHS) -> Self::Output;
+ }
+
+ #[lang = "bitxor_assign"]
+ pub trait BitXorAssign<RHS = Self> {
+ fn bitxor_assign(&mut self, rhs: RHS);
+ }
+
#[lang = "neg"]
pub trait Neg {
type Output;
@@ -134,10 +161,27 @@
type Output = $i;
fn sub(self, rhs: $i) -> $i { self - rhs }
}
- impl Bitor for $i {
+ impl BitAnd for $i {
+ type Output = $i;
+ fn bitand(self, rhs: $i) -> $i { self & rhs }
+ }
+ impl BitAndAssign for $i {
+ fn bitand_assign(&mut self, rhs: $i) { *self &= rhs; }
+ }
+ impl BitOr for $i {
type Output = $i;
fn bitor(self, rhs: $i) -> $i { self | rhs }
}
+ impl BitOrAssign for $i {
+ fn bitor_assign(&mut self, rhs: $i) { *self |= rhs; }
+ }
+ impl BitXor for $i {
+ type Output = $i;
+ fn bitxor(self, rhs: $i) -> $i { self ^ rhs }
+ }
+ impl BitXorAssign for $i {
+ fn bitxor_assign(&mut self, rhs: $i) { *self ^= rhs; }
+ }
impl Neg for $i {
type Output = $i;
fn neg(self) -> $i { -self }