File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,14 @@ impl<'tcx> Context for Tables<'tcx> {
42
42
Some ( self . crate_item ( self . tcx . entry_fn ( ( ) ) ?. 0 ) )
43
43
}
44
44
45
+ fn all_trait_decls ( & mut self ) -> stable_mir:: TraitDecls {
46
+ self . tcx
47
+ . traits ( LOCAL_CRATE )
48
+ . iter ( )
49
+ . map ( |trait_def_id| self . trait_def ( * trait_def_id) )
50
+ . collect ( )
51
+ }
52
+
45
53
fn trait_decl ( & mut self , trait_def : & stable_mir:: ty:: TraitDef ) -> stable_mir:: ty:: TraitDecl {
46
54
let def_id = self . trait_def_id ( trait_def) ;
47
55
let trait_def = self . tcx . trait_def ( def_id) ;
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ pub type DefId = usize;
32
32
/// A list of crate items.
33
33
pub type CrateItems = Vec < CrateItem > ;
34
34
35
+ /// A list of crate items.
36
+ pub type TraitDecls = Vec < TraitDef > ;
37
+
35
38
/// Holds information about a crate.
36
39
#[ derive( Clone , PartialEq , Eq , Debug ) ]
37
40
pub struct Crate {
@@ -84,6 +87,7 @@ pub trait Context {
84
87
/// Retrieve all items of the local crate that have a MIR associated with them.
85
88
fn all_local_items ( & mut self ) -> CrateItems ;
86
89
fn mir_body ( & mut self , item : & CrateItem ) -> mir:: Body ;
90
+ fn all_trait_decls ( & mut self ) -> TraitDecls ;
87
91
fn trait_decl ( & mut self , trait_def : & TraitDef ) -> TraitDecl ;
88
92
/// Get information about the local crate.
89
93
fn local_crate ( & self ) -> Crate ;
You can’t perform that action at this time.
0 commit comments