Lift TraitRef into rustc_type_ir

This commit is contained in:
Michael Goulet
2024-05-10 14:59:56 -04:00
parent 5e606c0bde
commit 1e5ec0a12c
51 changed files with 445 additions and 241 deletions

View File

@@ -145,6 +145,12 @@ pub struct Generics {
pub host_effect_index: Option<usize>,
}
impl<'tcx> rustc_type_ir::inherent::GenericsOf<TyCtxt<'tcx>> for &'tcx Generics {
fn count(&self) -> usize {
self.parent_count + self.own_params.len()
}
}
impl<'tcx> Generics {
/// Looks through the generics and all parents to find the index of the
/// given param def-id. This is in comparison to the `param_def_id_to_index`