1
Fork 0

Fix all_trait* methods to return all trait available

Also provide a mechanism to retrieve traits and implementations for a
given crate.
This commit is contained in:
Celina G. Val 2024-01-09 15:45:03 -08:00
parent 090d5eac72
commit af3c2c9f6d
6 changed files with 184 additions and 15 deletions

View file

@ -714,9 +714,16 @@ crate_def! {
}
crate_def! {
/// A trait's definition.
pub TraitDef;
}
impl TraitDef {
pub fn declaration(trait_def: &TraitDef) -> TraitDecl {
with(|cx| cx.trait_decl(trait_def))
}
}
crate_def! {
pub GenericDef;
}
@ -726,9 +733,17 @@ crate_def! {
}
crate_def! {
/// A trait impl definition.
pub ImplDef;
}
impl ImplDef {
/// Retrieve information about this implementation.
pub fn trait_impl(&self) -> ImplTrait {
with(|cx| cx.trait_impl(self))
}
}
crate_def! {
pub RegionDef;
}