]>
git.proxmox.com Git - rustc.git/blob - extra/bitflags-1.3.2/tests/compile-fail/non_integer_base/all_defined.rs
22 use bitflags
::bitflags
;
24 // Ideally we'd actually want this to work, but currently need something like `num`'s `Zero`
25 // With some design work it could be made possible
26 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
29 impl BitAnd
for MyInt
{
32 fn bitand(self, other
: Self) -> Self {
33 MyInt(self.0 & other
.0)
37 impl BitOr
for MyInt
{
40 fn bitor(self, other
: Self) -> Self {
41 MyInt(self.0 | other
.0)
45 impl BitXor
for MyInt
{
48 fn bitxor(self, other
: Self) -> Self {
49 MyInt(self.0 ^ other
.0)
53 impl BitAndAssign
for MyInt
{
54 fn bitand_assign(&mut self, other
: Self) {
59 impl BitOrAssign
for MyInt
{
60 fn bitor_assign(&mut self, other
: Self) {
65 impl BitXorAssign
for MyInt
{
66 fn bitxor_assign(&mut self, other
: Self) {
71 impl Debug
for MyInt
{
72 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
73 Debug
::fmt(&self.0, f
)
77 impl Display
for MyInt
{
78 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
79 Display
::fmt(&self.0, f
)
83 impl LowerHex
for MyInt
{
84 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
85 LowerHex
::fmt(&self.0, f
)
89 impl UpperHex
for MyInt
{
90 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
91 UpperHex
::fmt(&self.0, f
)
95 impl Octal
for MyInt
{
96 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
97 Octal
::fmt(&self.0, f
)
101 impl Binary
for MyInt
{
102 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
103 Binary
::fmt(&self.0, f
)
110 fn not(self) -> Self {
116 struct Flags128
: MyInt
{
117 const A
= MyInt(0b0000_0001u8);
118 const B
= MyInt(0b0000_0010u8);
119 const C
= MyInt(0b0000_0100u8);