Implement generics_of and predicates_of only for TraitDecl for now

This commit is contained in:
Santiago Pastorino 2023-08-28 17:39:52 -03:00
parent 0c301e9d36
commit 079e3732cc
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -135,12 +135,6 @@ impl ImplDef {
}
}
impl GenericDef {
pub fn generics_of(&self) -> Generics {
with(|cx| cx.generics_of(self.0))
}
}
#[derive(Clone, Debug)]
pub struct GenericArgs(pub Vec<GenericArgKind>);
@ -463,6 +457,16 @@ pub struct TraitDecl {
pub deny_explicit_impl: bool,
}
impl TraitDecl {
pub fn generics_of(&self) -> Generics {
with(|cx| cx.generics_of(self.def_id.0))
}
pub fn predicates_of(&self) -> GenericPredicates {
with(|cx| cx.predicates_of(self.def_id.0))
}
}
pub type ImplTrait = EarlyBinder<TraitRef>;
#[derive(Clone, Debug)]