Rollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwU
Consider `parent_count` for const param defaults Fixes #105257
This commit is contained in:
commit
62160cba7b
4 changed files with 33 additions and 1 deletions
|
@ -78,7 +78,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[¶m_id.to_def_id()];
|
||||
// In the above example this would be .params[..N#0]
|
||||
let params = generics.params[..param_def_idx as usize].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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue