Fix APIT
This commit is contained in:
parent
ed25cf70d5
commit
c6654fd4a7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user