Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/op.rs')
-rw-r--r--crates/hir-ty/src/infer/op.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/crates/hir-ty/src/infer/op.rs b/crates/hir-ty/src/infer/op.rs
index 8236de167f..c79c828cd4 100644
--- a/crates/hir-ty/src/infer/op.rs
+++ b/crates/hir-ty/src/infer/op.rs
@@ -39,7 +39,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
&& is_builtin_binop(lhs_ty, rhs_ty, category)
{
self.enforce_builtin_binop_types(lhs_ty, rhs_ty, category);
- self.types.unit
+ self.types.types.unit
} else {
return_ty
};
@@ -67,20 +67,20 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
// && and || are a simple case.
self.infer_expr_coerce(
lhs_expr,
- &Expectation::HasType(self.types.bool),
+ &Expectation::HasType(self.types.types.bool),
ExprIsRead::Yes,
);
let lhs_diverges = self.diverges;
self.infer_expr_coerce(
rhs_expr,
- &Expectation::HasType(self.types.bool),
+ &Expectation::HasType(self.types.types.bool),
ExprIsRead::Yes,
);
// Depending on the LHS' value, the RHS can never execute.
self.diverges = lhs_diverges;
- self.types.bool
+ self.types.types.bool
}
_ => {
// Otherwise, we always treat operators as if they are
@@ -131,9 +131,9 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
match category {
BinOpCategory::Shortcircuit => {
- self.demand_suptype(self.types.bool, lhs_ty);
- self.demand_suptype(self.types.bool, rhs_ty);
- self.types.bool
+ self.demand_suptype(self.types.types.bool, lhs_ty);
+ self.demand_suptype(self.types.types.bool, rhs_ty);
+ self.types.types.bool
}
BinOpCategory::Shift => {
@@ -150,7 +150,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
BinOpCategory::Comparison => {
// both LHS and RHS and result will have the same type
self.demand_suptype(lhs_ty, rhs_ty);
- self.types.bool
+ self.types.types.bool
}
}
}
@@ -213,7 +213,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
let mutbl = AutoBorrowMutability::new(mutbl, AllowTwoPhase::Yes);
let autoref = Adjustment {
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
- target: method.sig.inputs_and_output.inputs()[0],
+ target: method.sig.inputs_and_output.inputs()[0].store(),
};
self.write_expr_adj(lhs_expr, Box::new([autoref]));
}
@@ -227,7 +227,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
let autoref = Adjustment {
kind: Adjust::Borrow(AutoBorrow::Ref(mutbl)),
- target: method.sig.inputs_and_output.inputs()[1],
+ target: method.sig.inputs_and_output.inputs()[1].store(),
};
// HACK(eddyb) Bypass checks due to reborrows being in
// some cases applied on the RHS, on top of which we need
@@ -251,7 +251,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
}
Err(_errors) => {
// FIXME: Report diagnostic.
- self.types.error
+ self.types.types.error
}
};
@@ -271,7 +271,7 @@ impl<'a, 'db> InferenceContext<'a, 'db> {
}
Err(_errors) => {
// FIXME: Report diagnostic.
- self.types.error
+ self.types.types.error
}
}
}