From c6654fd4a70ef149a842e42dc9ef86838148fbe7 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 1 Feb 2020 17:45:43 +0100 Subject: Fix APIT --- crates/ra_hir_ty/src/lower.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates') diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index d60b59433..42367b181 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs @@ -31,6 +31,7 @@ use crate::{ 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 @@ impl Ty { 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 -- cgit v1.2.3