From 67240c8d915110fa0ad7392bb9a56e18e3bcf234 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 3 Jan 2020 14:57:11 +0100 Subject: Fix #2705 The `-` turned into a `+` during a refactoring. The original issue was caused by `Read` resolving wrongly to a trait without type parameters instead of a struct with one parameter; this only fixes the crash, not the wrong resolution. --- crates/ra_hir_ty/src/lower.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_ty/src/lower.rs') diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index af3db2e1d..2c2ecee9c 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs @@ -331,7 +331,7 @@ pub(super) fn substs_from_path_segment( if let Some(generic_args) = &segment.args_and_bindings { // if args are provided, it should be all of them, but we can't rely on that let self_param_correction = if add_self_param { 1 } else { 0 }; - let child_len = child_len + self_param_correction; + let child_len = child_len - self_param_correction; for arg in generic_args.args.iter().take(child_len) { match arg { GenericArg::Type(type_ref) => { -- cgit v1.2.3