diff options
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 6f9685b5..550ff90c 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -2009,8 +2009,43 @@ impl<'a> EnumBuilder<'a> { } ) .unwrap(); + result.push(impl_); + + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitOrAssign for $rust_ty { + #[inline] + fn bitor_assign(&mut self, rhs: $rust_ty) { + self.0 |= rhs.0; + } + } + ) + .unwrap(); + result.push(impl_); + + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitAnd<$rust_ty> for $rust_ty { + type Output = Self; + + #[inline] + fn bitand(self, other: Self) -> Self { + $rust_ty_name(self.0 & other.0) + } + } + ) + .unwrap(); + result.push(impl_); + let impl_ = quote_item!(ctx.ext_cx(), + impl ::$prefix::ops::BitAndAssign for $rust_ty { + #[inline] + fn bitand_assign(&mut self, rhs: $rust_ty) { + self.0 &= rhs.0; + } + } + ) + .unwrap(); result.push(impl_); + aster } EnumBuilder::Consts { aster, .. } => aster, |