diff options
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
-rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index b99b6cd21..dd3914ec3 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs | |||
@@ -455,7 +455,7 @@ impl<'a> InferenceContext<'a> { | |||
455 | }) | 455 | }) |
456 | .unwrap_or(true) | 456 | .unwrap_or(true) |
457 | }; | 457 | }; |
458 | match canonicalized.decanonicalize_ty(derefed_ty.value).interned(&Interner) { | 458 | match canonicalized.decanonicalize_ty(derefed_ty.value).kind(&Interner) { |
459 | TyKind::Tuple(_, substs) => name.as_tuple_index().and_then(|idx| { | 459 | TyKind::Tuple(_, substs) => name.as_tuple_index().and_then(|idx| { |
460 | substs | 460 | substs |
461 | .interned(&Interner) | 461 | .interned(&Interner) |
@@ -577,7 +577,7 @@ impl<'a> InferenceContext<'a> { | |||
577 | None => self.err_ty(), | 577 | None => self.err_ty(), |
578 | }, | 578 | }, |
579 | UnaryOp::Neg => { | 579 | UnaryOp::Neg => { |
580 | match inner_ty.interned(&Interner) { | 580 | match inner_ty.kind(&Interner) { |
581 | // Fast path for builtins | 581 | // Fast path for builtins |
582 | TyKind::Scalar(Scalar::Int(_)) | 582 | TyKind::Scalar(Scalar::Int(_)) |
583 | | TyKind::Scalar(Scalar::Uint(_)) | 583 | | TyKind::Scalar(Scalar::Uint(_)) |
@@ -590,7 +590,7 @@ impl<'a> InferenceContext<'a> { | |||
590 | } | 590 | } |
591 | } | 591 | } |
592 | UnaryOp::Not => { | 592 | UnaryOp::Not => { |
593 | match inner_ty.interned(&Interner) { | 593 | match inner_ty.kind(&Interner) { |
594 | // Fast path for builtins | 594 | // Fast path for builtins |
595 | TyKind::Scalar(Scalar::Bool) | 595 | TyKind::Scalar(Scalar::Bool) |
596 | | TyKind::Scalar(Scalar::Int(_)) | 596 | | TyKind::Scalar(Scalar::Int(_)) |
@@ -696,7 +696,7 @@ impl<'a> InferenceContext<'a> { | |||
696 | } | 696 | } |
697 | } | 697 | } |
698 | Expr::Tuple { exprs } => { | 698 | Expr::Tuple { exprs } => { |
699 | let mut tys = match expected.ty.interned(&Interner) { | 699 | let mut tys = match expected.ty.kind(&Interner) { |
700 | TyKind::Tuple(_, substs) => substs | 700 | TyKind::Tuple(_, substs) => substs |
701 | .iter(&Interner) | 701 | .iter(&Interner) |
702 | .map(|a| a.assert_ty_ref(&Interner).clone()) | 702 | .map(|a| a.assert_ty_ref(&Interner).clone()) |
@@ -713,7 +713,7 @@ impl<'a> InferenceContext<'a> { | |||
713 | TyKind::Tuple(tys.len(), Substitution::from_iter(&Interner, tys)).intern(&Interner) | 713 | TyKind::Tuple(tys.len(), Substitution::from_iter(&Interner, tys)).intern(&Interner) |
714 | } | 714 | } |
715 | Expr::Array(array) => { | 715 | Expr::Array(array) => { |
716 | let elem_ty = match expected.ty.interned(&Interner) { | 716 | let elem_ty = match expected.ty.kind(&Interner) { |
717 | TyKind::Array(st) | TyKind::Slice(st) => st.clone(), | 717 | TyKind::Array(st) | TyKind::Slice(st) => st.clone(), |
718 | _ => self.table.new_type_var(), | 718 | _ => self.table.new_type_var(), |
719 | }; | 719 | }; |
@@ -961,7 +961,7 @@ impl<'a> InferenceContext<'a> { | |||
961 | } | 961 | } |
962 | 962 | ||
963 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { | 963 | fn register_obligations_for_call(&mut self, callable_ty: &Ty) { |
964 | if let TyKind::FnDef(fn_def, parameters) = callable_ty.interned(&Interner) { | 964 | if let TyKind::FnDef(fn_def, parameters) = callable_ty.kind(&Interner) { |
965 | let def: CallableDefId = from_chalk(self.db, *fn_def); | 965 | let def: CallableDefId = from_chalk(self.db, *fn_def); |
966 | let generic_predicates = self.db.generic_predicates(def.into()); | 966 | let generic_predicates = self.db.generic_predicates(def.into()); |
967 | for predicate in generic_predicates.iter() { | 967 | for predicate in generic_predicates.iter() { |