Skip to content

Commit ec96e02

Browse files
committed
Slightly simplify maybe_codegen_checked
1 parent c74c817 commit ec96e02

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/codegen_i128.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub(crate) fn maybe_codegen_checked<'tcx>(
7979
let is_signed = type_sign(lhs.layout().ty);
8080

8181
match bin_op {
82-
BinOp::BitAnd | BinOp::BitOr | BinOp::BitXor => unreachable!(),
8382
BinOp::Add | BinOp::Sub => None,
8483
BinOp::Mul => {
8584
let out_ty = Ty::new_tup(fx.tcx, &[lhs.layout().ty, fx.tcx.types.bool]);
@@ -98,12 +97,6 @@ pub(crate) fn maybe_codegen_checked<'tcx>(
9897
);
9998
Some(out_place.to_cvalue(fx))
10099
}
101-
BinOp::AddUnchecked | BinOp::SubUnchecked | BinOp::MulUnchecked => unreachable!(),
102-
BinOp::AddWithOverflow | BinOp::SubWithOverflow | BinOp::MulWithOverflow => unreachable!(),
103-
BinOp::Offset => unreachable!("offset should only be used on pointers, not 128bit ints"),
104-
BinOp::Div | BinOp::Rem => unreachable!(),
105-
BinOp::Cmp => unreachable!(),
106-
BinOp::Lt | BinOp::Le | BinOp::Eq | BinOp::Ge | BinOp::Gt | BinOp::Ne => unreachable!(),
107-
BinOp::Shl | BinOp::ShlUnchecked | BinOp::Shr | BinOp::ShrUnchecked => unreachable!(),
100+
_ => bug!("binop {:?} on checked int/uint lhs: {:?} rhs: {:?}", bin_op, lhs, rhs),
108101
}
109102
}

0 commit comments

Comments
 (0)