Push the correct instructions to execute `binary_op` on operands of type `lhs_ty` and `rhs_ty`
(
&mut self,
binary_op: SymBinaryOp,
lhs_ty: SymTy<'db>,
rhs_ty: SymTy<'db>,
)
| 224 | |
| 225 | /// Push the correct instructions to execute `binary_op` on operands of type `lhs_ty` and `rhs_ty` |
| 226 | fn execute_binary_op( |
| 227 | &mut self, |
| 228 | binary_op: SymBinaryOp, |
| 229 | lhs_ty: SymTy<'db>, |
| 230 | rhs_ty: SymTy<'db>, |
| 231 | ) { |
| 232 | match self.primitive_kind(lhs_ty) { |
| 233 | Ok(prim_kind) => { |
| 234 | assert_eq!(self.primitive_kind(rhs_ty), Ok(prim_kind)); |
| 235 | self.execute_binary_op_on_primitives(binary_op, prim_kind) |
| 236 | } |
| 237 | Err(e) => match e { |
| 238 | NotPrimitive::DeadCode => (), |
| 239 | NotPrimitive::OtherType => { |
| 240 | panic!("don't know how to execute a binary op on ({lhs_ty:?}, {rhs_ty:?})") |
| 241 | } |
| 242 | }, |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /// Push the correct instructions to execute `binary_op` on operands of type `prim_kind` |
| 247 | fn execute_binary_op_on_primitives( |
no test coverage detected