I think the best solution is to add uN and sN types where N is not a power of 
two, which LLVM should already support.

Then you can write your match like this:
match (val >> 6) as u2
{
  ...
}

And it will work as desired.

Biggest issue is that to make it work nicely you'd need to add some way to 
generalize over the bit-length and integers, and that's going to require 
generics with int parameters and work to add those.

                                          
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to