From 170cdf90769d7a2779ffd0a8cb552e5b2f63d11c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 19 Jun 2020 18:32:42 +0200 Subject: Shift bound variables correctly when using assoc type shorthand Fixes #4885. Fixes #4800. --- crates/ra_hir_ty/src/lower.rs | 3 +++ 1 file changed, 3 insertions(+) (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 7a7fcb0ab..d5154f436 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs @@ -467,6 +467,9 @@ impl Ty { } TypeParamLoweringMode::Variable => t.substs.clone(), }; + // We need to shift in the bound vars, since + // associated_type_shorthand_candidates does not do that + let substs = substs.shift_bound_vars(ctx.in_binders); // FIXME handle type parameters on the segment return Some(Ty::Projection(ProjectionTy { associated_ty, -- cgit v1.2.3