1
Fork 0

Remove unimplemented!() from BinOp::ty() function

To reduce redundancy, we now internalize the BinOp instead of
duplicating the `ty()` function body.
This commit is contained in:
Celina G. Val 2024-04-08 15:41:00 -07:00
parent ea40fa210b
commit 0a4f4a3e29
5 changed files with 196 additions and 39 deletions

View file

@ -8,7 +8,7 @@ use std::cell::Cell;
use crate::abi::{FnAbi, Layout, LayoutShape};
use crate::mir::alloc::{AllocId, GlobalAlloc};
use crate::mir::mono::{Instance, InstanceDef, StaticDef};
use crate::mir::{Body, Place};
use crate::mir::{BinOp, Body, Place};
use crate::target::MachineInfo;
use crate::ty::{
AdtDef, AdtKind, Allocation, ClosureDef, ClosureKind, Const, FieldDef, FnDef, ForeignDef,
@ -211,6 +211,9 @@ pub trait Context {
/// Get a debug string representation of a place.
fn place_pretty(&self, place: &Place) -> String;
/// Get the resulting type of binary operation.
fn binop_ty(&self, bin_op: BinOp, rhs: Ty, lhs: Ty) -> Ty;
}
// A thread local variable that stores a pointer to the tables mapping between TyCtxt