From c6654fd4a70ef149a842e42dc9ef86838148fbe7 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 1 Feb 2020 17:45:43 +0100 Subject: [PATCH] Fix APIT --- crates/ra_hir_ty/src/lower.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index d60b5943342..42367b1814d 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs @@ -31,6 +31,7 @@ TraitEnvironment, TraitRef, Ty, TypeCtor, }; use hir_def::TypeParamId; +use hir_def::generics::TypeParamProvenance; #[derive(Debug)] pub struct TyLoweringContext<'a, DB: HirDatabase> { @@ -149,6 +150,7 @@ pub fn from_hir(ctx: &TyLoweringContext<'_, impl HirDatabase>, type_ref: &TypeRe let generics = generics(ctx.db, def); let param = generics .iter() + .filter(|(_, data)| data.provenance == TypeParamProvenance::ArgumentImplTrait) .nth(idx as usize) .map_or(Ty::Unknown, |(id, _)| Ty::Param(id)); param