-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)

Description
Consider the following code:
let a = 0b11;
let b = match a {
0b01 | 0b10 => true,
_ => false
};
io::println(b.to_str());
The output is false
, but let b = (a == 0b01 | 0b10);
yields true
.
I don't know how common patterns containing bitwise ors would be, but it seems inconsistent for this operator to be unavailable when the other arithmetic and bitwise ops function as expected here:
let a = 0b11;
let b = match a {
0b01 + 0b10 => true,
_ => false
};
io::println(b.to_str());
The output is true
.
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)