From ae8a8020857080ea527cc1d0e57a592d6e587a64 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 13 Dec 2020 11:34:44 +0100 Subject: Ignore lifetime params in substitutions --- crates/hir_ty/src/infer/expr.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/hir_ty/src/infer') diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index ca005bc99..2cdce2cef 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -856,7 +856,12 @@ impl<'a> InferenceContext<'a> { // handle provided type arguments if let Some(generic_args) = generic_args { // if args are provided, it should be all of them, but we can't rely on that - for arg in generic_args.args.iter().take(type_params) { + for arg in generic_args + .args + .iter() + .filter(|arg| matches!(arg, GenericArg::Type(_))) + .take(type_params) + { match arg { GenericArg::Type(type_ref) => { let ty = self.make_ty(type_ref); -- cgit v1.2.3