1
Fork 0

add a test case for generic_const_exprs in trait items

This commit is contained in:
Takayuki Maeda 2022-12-08 14:11:29 +09:00
parent cb596e3015
commit 85d7d9b6b7
4 changed files with 11 additions and 4 deletions

View file

@ -79,7 +79,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
let generics = tcx.generics_of(parent_def_id.to_def_id());
let param_def_idx = generics.param_def_id_to_index[&param_id.to_def_id()];
// In the above example this would be .params[..N#0]
let params = generics.param_to(param_def_idx as usize, tcx).to_owned();
let params = generics.params_to(param_def_idx as usize, tcx).to_owned();
let param_def_id_to_index =
params.iter().map(|param| (param.def_id, param.index)).collect();