aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/op.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-03 12:08:29 +0100
committerFlorian Diebold <[email protected]>2021-04-03 12:08:29 +0100
commitc551604b5a0b74a43f5efe567bcbd979daa2f3cc (patch)
treeaba0fc8a8b9dcd3456f47ae5cd28fa672a7a6911 /crates/hir_ty/src/op.rs
parent8289b96216b5d4ddd0b6cf9feccb7af574d022a8 (diff)
Rename Ty::interned to Ty::kind
... since that's the actual method on Chalk side that matches the signature.
Diffstat (limited to 'crates/hir_ty/src/op.rs')
-rw-r--r--crates/hir_ty/src/op.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/op.rs b/crates/hir_ty/src/op.rs
index 527c5cbbd..8533e1ed8 100644
--- a/crates/hir_ty/src/op.rs
+++ b/crates/hir_ty/src/op.rs
@@ -9,7 +9,7 @@ pub(super) fn binary_op_return_ty(op: BinaryOp, lhs_ty: Ty, rhs_ty: Ty) -> Ty {
9 BinaryOp::LogicOp(_) | BinaryOp::CmpOp(_) => TyKind::Scalar(Scalar::Bool).intern(&Interner), 9 BinaryOp::LogicOp(_) | BinaryOp::CmpOp(_) => TyKind::Scalar(Scalar::Bool).intern(&Interner),
10 BinaryOp::Assignment { .. } => Ty::unit(), 10 BinaryOp::Assignment { .. } => Ty::unit(),
11 BinaryOp::ArithOp(ArithOp::Shl) | BinaryOp::ArithOp(ArithOp::Shr) => { 11 BinaryOp::ArithOp(ArithOp::Shl) | BinaryOp::ArithOp(ArithOp::Shr) => {
12 match lhs_ty.interned(&Interner) { 12 match lhs_ty.kind(&Interner) {
13 TyKind::Scalar(Scalar::Int(_)) 13 TyKind::Scalar(Scalar::Int(_))
14 | TyKind::Scalar(Scalar::Uint(_)) 14 | TyKind::Scalar(Scalar::Uint(_))
15 | TyKind::Scalar(Scalar::Float(_)) => lhs_ty, 15 | TyKind::Scalar(Scalar::Float(_)) => lhs_ty,
@@ -18,7 +18,7 @@ pub(super) fn binary_op_return_ty(op: BinaryOp, lhs_ty: Ty, rhs_ty: Ty) -> Ty {
18 _ => TyKind::Unknown.intern(&Interner), 18 _ => TyKind::Unknown.intern(&Interner),
19 } 19 }
20 } 20 }
21 BinaryOp::ArithOp(_) => match rhs_ty.interned(&Interner) { 21 BinaryOp::ArithOp(_) => match rhs_ty.kind(&Interner) {
22 TyKind::Scalar(Scalar::Int(_)) 22 TyKind::Scalar(Scalar::Int(_))
23 | TyKind::Scalar(Scalar::Uint(_)) 23 | TyKind::Scalar(Scalar::Uint(_))
24 | TyKind::Scalar(Scalar::Float(_)) => rhs_ty, 24 | TyKind::Scalar(Scalar::Float(_)) => rhs_ty,
@@ -33,7 +33,7 @@ pub(super) fn binary_op_rhs_expectation(op: BinaryOp, lhs_ty: Ty) -> Ty {
33 match op { 33 match op {
34 BinaryOp::LogicOp(..) => TyKind::Scalar(Scalar::Bool).intern(&Interner), 34 BinaryOp::LogicOp(..) => TyKind::Scalar(Scalar::Bool).intern(&Interner),
35 BinaryOp::Assignment { op: None } => lhs_ty, 35 BinaryOp::Assignment { op: None } => lhs_ty,
36 BinaryOp::CmpOp(CmpOp::Eq { .. }) => match lhs_ty.interned(&Interner) { 36 BinaryOp::CmpOp(CmpOp::Eq { .. }) => match lhs_ty.kind(&Interner) {
37 TyKind::Scalar(_) | TyKind::Str => lhs_ty, 37 TyKind::Scalar(_) | TyKind::Str => lhs_ty,
38 TyKind::InferenceVar(_, TyVariableKind::Integer) 38 TyKind::InferenceVar(_, TyVariableKind::Integer)
39 | TyKind::InferenceVar(_, TyVariableKind::Float) => lhs_ty, 39 | TyKind::InferenceVar(_, TyVariableKind::Float) => lhs_ty,
@@ -44,7 +44,7 @@ pub(super) fn binary_op_rhs_expectation(op: BinaryOp, lhs_ty: Ty) -> Ty {
44 } 44 }
45 BinaryOp::CmpOp(CmpOp::Ord { .. }) 45 BinaryOp::CmpOp(CmpOp::Ord { .. })
46 | BinaryOp::Assignment { op: Some(_) } 46 | BinaryOp::Assignment { op: Some(_) }
47 | BinaryOp::ArithOp(_) => match lhs_ty.interned(&Interner) { 47 | BinaryOp::ArithOp(_) => match lhs_ty.kind(&Interner) {
48 TyKind::Scalar(Scalar::Int(_)) 48 TyKind::Scalar(Scalar::Int(_))
49 | TyKind::Scalar(Scalar::Uint(_)) 49 | TyKind::Scalar(Scalar::Uint(_))
50 | TyKind::Scalar(Scalar::Float(_)) => lhs_ty, 50 | TyKind::Scalar(Scalar::Float(_)) => lhs_ty,