diff options
author | Daniel Mueller <deso@posteo.net> | 2018-01-15 09:30:24 -0800 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2018-01-15 09:30:24 -0800 |
commit | d8a58488bd56ef9c09e167173124c3519bc7405d (patch) | |
tree | f52c843b4862a8ce80b3912805638be5846166fc /libc/src/dox.rs | |
parent | 7e6a449f276cd85ebd9201ef1a62aff3bc4d1595 (diff) | |
download | nitrocli-d8a58488bd56ef9c09e167173124c3519bc7405d.tar.gz nitrocli-d8a58488bd56ef9c09e167173124c3519bc7405d.tar.bz2 |
Update libc crate to 0.2.36
Import subrepo libc/:libc at 16a0f4a3d6c836f88f50c58f5d0a74a32cbf0193
Diffstat (limited to 'libc/src/dox.rs')
-rw-r--r-- | libc/src/dox.rs | 100 |
1 files changed, 38 insertions, 62 deletions
diff --git a/libc/src/dox.rs b/libc/src/dox.rs index 41aac38..5c095b9 100644 --- a/libc/src/dox.rs +++ b/libc/src/dox.rs @@ -63,113 +63,89 @@ mod imp { fn div(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_div { - ($($i:ident)*) => ($( - impl Div<$i> for $i { - type Output = $i; - fn div(self, rhs: $i) -> $i { self / rhs } - } - )*) - } - each_int!(impl_div); - #[lang = "shl"] pub trait Shl<RHS> { type Output; fn shl(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_shl { - ($($i:ident)*) => ($( - impl Shl<$i> for $i { - type Output = $i; - fn shl(self, rhs: $i) -> $i { self << rhs } - } - )*) - } - each_int!(impl_shl); - #[lang = "mul"] pub trait Mul<RHS=Self> { type Output; fn mul(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_mul { - ($($i:ident)*) => ($( - impl Mul for $i { - type Output = $i; - fn mul(self, rhs: $i) -> $i { self * rhs } - } - )*) - } - each_int!(impl_mul); - #[lang = "sub"] pub trait Sub<RHS=Self> { type Output; fn sub(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_sub { - ($($i:ident)*) => ($( - impl Sub for $i { - type Output = $i; - fn sub(self, rhs: $i) -> $i { self - rhs } - } - )*) - } - each_int!(impl_sub); - #[lang = "bitor"] pub trait Bitor<RHS=Self> { type Output; fn bitor(self, rhs: RHS) -> Self::Output; } - macro_rules! impl_bitor { - ($($i:ident)*) => ($( - impl Bitor for $i { - type Output = $i; - fn bitor(self, rhs: $i) -> $i { self | rhs } - } - )*) - } - each_int!(impl_bitor); - #[lang = "neg"] pub trait Neg { type Output; fn neg(self) -> Self::Output; } - macro_rules! impl_neg { - ($($i:ident)*) => ($( - impl Neg for $i { - type Output = $i; - fn neg(self) -> $i { -self } - } - )*) - } - each_signed_int!(impl_neg); - #[lang = "not"] pub trait Not { type Output; fn not(self) -> Self::Output; } - macro_rules! impl_not { + #[lang = "add"] + pub trait Add<RHS = Self> { + type Output; + fn add(self, r: RHS) -> Self::Output; + } + + macro_rules! impl_traits { ($($i:ident)*) => ($( + impl Div<$i> for $i { + type Output = $i; + fn div(self, rhs: $i) -> $i { self / rhs } + } + impl Shl<$i> for $i { + type Output = $i; + fn shl(self, rhs: $i) -> $i { self << rhs } + } + impl Mul for $i { + type Output = $i; + fn mul(self, rhs: $i) -> $i { self * rhs } + } + + impl Sub for $i { + type Output = $i; + fn sub(self, rhs: $i) -> $i { self - rhs } + } + impl Bitor for $i { + type Output = $i; + fn bitor(self, rhs: $i) -> $i { self | rhs } + } + impl Neg for $i { + type Output = $i; + fn neg(self) -> $i { -self } + } impl Not for $i { type Output = $i; fn not(self) -> $i { !self } } + impl Add<$i> for $i { + type Output = $i; + fn add(self, other: $i) -> $i { self + other } + } )*) } - each_int!(impl_not); + each_int!(impl_traits); pub mod mem { pub fn size_of_val<T>(_: &T) -> usize { 4 } + pub fn size_of<T>(_: &T) -> usize { 4 } } } |