File tree 3 files changed +399
-192
lines changed
3 files changed +399
-192
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ pub fn generator_def(did: DefId) -> stable_mir::ty::GeneratorDef {
47
47
with_tables ( |t| t. generator_def ( did) )
48
48
}
49
49
50
+ pub fn param_def ( did : DefId ) -> stable_mir:: ty:: ParamDef {
51
+ with_tables ( |t| t. param_def ( did) )
52
+ }
53
+
54
+ pub fn br_named_def ( did : DefId ) -> stable_mir:: ty:: BrNamedDef {
55
+ with_tables ( |t| t. br_named_def ( did) )
56
+ }
57
+
50
58
impl < ' tcx > Tables < ' tcx > {
51
59
pub fn item_def_id ( & self , item : & stable_mir:: CrateItem ) -> DefId {
52
60
self . def_ids [ item. 0 ]
@@ -76,6 +84,14 @@ impl<'tcx> Tables<'tcx> {
76
84
stable_mir:: ty:: GeneratorDef ( self . create_def_id ( did) )
77
85
}
78
86
87
+ pub fn param_def ( & mut self , did : DefId ) -> stable_mir:: ty:: ParamDef {
88
+ stable_mir:: ty:: ParamDef ( self . create_def_id ( did) )
89
+ }
90
+
91
+ pub fn br_named_def ( & mut self , did : DefId ) -> stable_mir:: ty:: BrNamedDef {
92
+ stable_mir:: ty:: BrNamedDef ( self . create_def_id ( did) )
93
+ }
94
+
79
95
fn create_def_id ( & mut self , did : DefId ) -> stable_mir:: DefId {
80
96
// FIXME: this becomes inefficient when we have too many ids
81
97
for ( i, & d) in self . def_ids . iter ( ) . enumerate ( ) {
You can’t perform that action at this time.
0 commit comments