add a comment explaining the magic numbers

上级 3e3aeab0
......@@ -69,6 +69,8 @@ fn unrelated_ptr_ops<'tcx>(bin_op: mir::BinOp) -> EvalResult<'tcx, PrimVal> {
match bin_op {
// can have rhs with a different numeric type
Shl | Shr => {
// these numbers are the maximum number of bits a bitshift rhs could possibly have
// e.g. u16 can be bitshifted by 0..16, so 2^4 - 1 is the largest possible bitshift
let mask_bits = match left {
I8(_) => 3,
I16(_) => 4,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册