From 48ffbf29b799d4d2897d84f9902230e138b3c540 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 3 Sep 2019 08:59:09 +0300 Subject: use recrod terminology for hir::Pat --- crates/ra_hir/src/ty/infer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 9ba146299..12d7bb174 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -749,7 +749,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { let is_non_ref_pat = match &body[pat] { Pat::Tuple(..) | Pat::TupleStruct { .. } - | Pat::Struct { .. } + | Pat::Record { .. } | Pat::Range { .. } | Pat::Slice { .. } => true, // FIXME: Path/Lit might actually evaluate to ref, but inference is unimplemented. @@ -809,7 +809,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { Pat::TupleStruct { path: ref p, args: ref subpats } => { self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) } - Pat::Struct { path: ref p, args: ref fields } => { + Pat::Record { path: ref p, args: ref fields } => { self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) } Pat::Path(path) => { -- cgit v1.2.3 From 82b218b7bf19365fd881c1a4797a49efe3661ce6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 3 Sep 2019 08:59:44 +0300 Subject: remove needless refs --- crates/ra_hir/src/ty/infer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 12d7bb174..61ea35dd7 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -806,10 +806,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { let subty = self.infer_pat(*pat, expectation, default_bm); Ty::apply_one(TypeCtor::Ref(*mutability), subty) } - Pat::TupleStruct { path: ref p, args: ref subpats } => { + Pat::TupleStruct { path: p, args: subpats } => { self.infer_tuple_struct_pat(p.as_ref(), subpats, expected, default_bm) } - Pat::Record { path: ref p, args: ref fields } => { + Pat::Record { path: p, args: fields } => { self.infer_record_pat(p.as_ref(), fields, expected, default_bm, pat) } Pat::Path(path) => { -- cgit v1.2.3 From da850361ba22c78ed3579c33d6748735dcd2885c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 3 Sep 2019 09:01:09 +0300 Subject: clearer ignore --- crates/ra_hir/src/ty/infer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 61ea35dd7..b89a40b4b 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs @@ -817,7 +817,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { let resolver = self.resolver.clone(); self.infer_path_expr(&resolver, &path, pat.into()).unwrap_or(Ty::Unknown) } - Pat::Bind { mode, name: _name, subpat } => { + Pat::Bind { mode, name: _, subpat } => { let mode = if mode == &BindingAnnotation::Unannotated { default_bm } else { -- cgit v1.2.3