minirust
minirust copied to clipboard
Add missing operators
Rust has a bunch of operators that we do not support yet:
- [x] BitOr, BitXor (on integers and Booleans)
- [x] Shl, Shr
- [x] Cmp
- [x] checked operators (in MIR encoded via a separate
Rvalue::CheckedBinaryOp
) -- AFAIK this is only allowed for Add, Sub, Mul; they should become separate BinOp for us - [x] some intrinsics that are lowered to binops: AddUnchecked, SubUnchecked, MulUnchecked, ShlUnchecked, ShrUnchecked
- [x]
UnOp::Not
, which we support for Booleans but not for integers - [x] Comparison operators on
bool
(here it seems best to not add anything new to MiniRust, and teach minimize to translate this to operations on integers) - [ ] Comparison operators on pointers (probably also best done via casts)