This commit is contained in:
Florian Diebold 2020-02-01 17:45:43 +01:00 committed by Florian Diebold
parent ed25cf70d5
commit c6654fd4a7

View File

@ -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