diff options
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 812990426..ec3b7ffef 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -30,7 +30,7 @@ use super::{ | |||
30 | autoderef, lower, method_resolution, op, primitive, | 30 | autoderef, lower, method_resolution, op, primitive, |
31 | traits::{Guidance, Obligation, ProjectionPredicate, Solution}, | 31 | traits::{Guidance, Obligation, ProjectionPredicate, Solution}, |
32 | ApplicationTy, CallableDef, InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, | 32 | ApplicationTy, CallableDef, InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, |
33 | Ty, TypableDef, TypeCtor, | 33 | Ty, TypableDef, TypeCtor, TypeWalk, |
34 | }; | 34 | }; |
35 | use crate::{ | 35 | use crate::{ |
36 | adt::VariantDef, | 36 | adt::VariantDef, |
@@ -50,8 +50,8 @@ use crate::{ | |||
50 | }, | 50 | }, |
51 | ty::infer::diagnostics::InferenceDiagnostic, | 51 | ty::infer::diagnostics::InferenceDiagnostic, |
52 | type_ref::{Mutability, TypeRef}, | 52 | type_ref::{Mutability, TypeRef}, |
53 | AdtDef, ConstData, DefWithBody, FnData, Function, HirDatabase, ImplItem, ModuleDef, Name, Path, | 53 | AdtDef, ConstData, DefWithBody, FnData, Function, HasBody, HirDatabase, ImplItem, ModuleDef, |
54 | StructField, | 54 | Name, Path, StructField, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | mod unify; | 57 | mod unify; |
@@ -749,7 +749,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
749 | let is_non_ref_pat = match &body[pat] { | 749 | let is_non_ref_pat = match &body[pat] { |
750 | Pat::Tuple(..) | 750 | Pat::Tuple(..) |
751 | | Pat::TupleStruct { .. } | 751 | | Pat::TupleStruct { .. } |
752 | | Pat::Struct { .. } | 752 | | Pat::Record { .. } |
753 | | Pat::Range { .. } | 753 | | Pat::Range { .. } |
754 | | Pat::Slice { .. } => true, | 754 | | Pat::Slice { .. } => true, |
755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. | 755 | // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. |
@@ -806,10 +806,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
806 | let subty = self.infer_pat(*pat, expectation, default_bm); | 806 | let subty = self.infer_pat(*pat, expectation, default_bm); |
807 | Ty::apply_one(TypeCtor::Ref(*mutability), subty) | 807 | Ty::apply_one(TypeCtor::Ref(*mutability), subty) |
808 | } | 808 | } |
809 | Pat::TupleStruct { path: ref p, args: ref subpats } => { | 809 | Pat::TupleStruct { path: p, args: subpats } => { |
810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) | 810 | self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) |
811 | } | 811 | } |
812 | Pat::Struct { path: ref p, args: ref fields } => { | 812 | Pat::Record { path: p, args: fields } => { |
813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) | 813 | self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) |
814 | } | 814 | } |
815 | Pat::Path(path) => { | 815 | Pat::Path(path) => { |
@@ -817,7 +817,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
817 | let resolver = self.resolver.clone(); | 817 | let resolver = self.resolver.clone(); |
818 | self.infer_path_expr(&resolver, &path, pat.into()).unwrap_or(Ty::Unknown) | 818 | self.infer_path_expr(&resolver, &path, pat.into()).unwrap_or(Ty::Unknown) |
819 | } | 819 | } |
820 | Pat::Bind { mode, name: _name, subpat } => { | 820 | Pat::Bind { mode, name: _, subpat } => { |
821 | let mode = if mode == &BindingAnnotation::Unannotated { | 821 | let mode = if mode == &BindingAnnotation::Unannotated { |
822 | default_bm | 822 | default_bm |
823 | } else { | 823 | } else { |