On Fri, Mar 28, 2014 at 9:57 AM, Evan G <[email protected]> wrote:
> This doesn't even need to be a very hard feature to implement, or require
> any new syntax. All that needs to happen is for the compiler to know that "&
> 0b11" means the only viable options are 00, 01, 10, and 11. True?

This is true, but doesn't mesh well with how match blocks are defined.
The exhaustiveness checks verify that match arms cover all cases of
the matched type, which in the case of these bit masking operations is
an integer.

The compiler is aware of these restrictions at some level (LLVM is
able to optimize based on it, but I don't think rustc is explicitly
aware of such bounds), but needs a way to represent the bounds on that
value. The natural way to do so is with an n-bit integer type.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to