From 4a6cdd776d403bacce0a5471d77e8c76695c5bc5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 16:59:23 +0200 Subject: Record method call substs and use them in call info --- crates/hir_ty/src/diagnostics/expr.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'crates/hir_ty/src/diagnostics/expr.rs') diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 53c4ee9da..d1f113e7f 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs @@ -181,7 +181,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> { for (id, expr) in body.exprs.iter() { if let Expr::MethodCall { receiver, .. } = expr { let function_id = match self.infer.method_resolution(id) { - Some(id) => id, + Some((id, _)) => id, None => continue, }; @@ -239,15 +239,11 @@ impl<'a, 'b> ExprValidator<'a, 'b> { return; } - // FIXME: note that we erase information about substs here. This - // is not right, but, luckily, doesn't matter as we care only - // about the number of params - let callee = match self.infer.method_resolution(call_id) { - Some(callee) => callee, + let (callee, subst) = match self.infer.method_resolution(call_id) { + Some(it) => it, None => return, }; - let sig = - db.callable_item_signature(callee.into()).into_value_and_skipped_binders().0; + let sig = db.callable_item_signature(callee.into()).substitute(&Interner, &subst); (sig, args) } -- cgit v1.2.3