about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-09 15:28:02 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2025-01-09 15:28:50 +0000
commitec96e028a79a39fe743ba97aafdb20bdda7df1b5 (patch)
tree2b4e14abed00ba28fcb78d9852080c8348146719
parentc74c817fb7da588c236d7368ccac41b47fe1fad8 (diff)
downloadrust-ec96e028a79a39fe743ba97aafdb20bdda7df1b5.tar.gz
rust-ec96e028a79a39fe743ba97aafdb20bdda7df1b5.zip
Slightly simplify maybe_codegen_checked
-rw-r--r--src/codegen_i128.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/codegen_i128.rs b/src/codegen_i128.rs
index 734574338d0..7e260e6d7bd 100644
--- a/src/codegen_i128.rs
+++ b/src/codegen_i128.rs
@@ -79,7 +79,6 @@ pub(crate) fn maybe_codegen_checked<'tcx>(
     let is_signed = type_sign(lhs.layout().ty);
 
     match bin_op {
-        BinOp::BitAnd | BinOp::BitOr | BinOp::BitXor => unreachable!(),
         BinOp::Add | BinOp::Sub => None,
         BinOp::Mul => {
             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>(
             );
             Some(out_place.to_cvalue(fx))
         }
-        BinOp::AddUnchecked | BinOp::SubUnchecked | BinOp::MulUnchecked => unreachable!(),
-        BinOp::AddWithOverflow | BinOp::SubWithOverflow | BinOp::MulWithOverflow => unreachable!(),
-        BinOp::Offset => unreachable!("offset should only be used on pointers, not 128bit ints"),
-        BinOp::Div | BinOp::Rem => unreachable!(),
-        BinOp::Cmp => unreachable!(),
-        BinOp::Lt | BinOp::Le | BinOp::Eq | BinOp::Ge | BinOp::Gt | BinOp::Ne => unreachable!(),
-        BinOp::Shl | BinOp::ShlUnchecked | BinOp::Shr | BinOp::ShrUnchecked => unreachable!(),
+        _ => bug!("binop {:?} on checked int/uint lhs: {:?} rhs: {:?}", bin_op, lhs, rhs),
     }
 }