Skip to content

Commit b91c41b

Browse files
authored
Rollup merge of #113910 - spastorino:smir-types-5, r=oli-obk
Add FnPtr ty to SMIR r? `@oli-obk`
2 parents af1e082 + 634db10 commit b91c41b

File tree

3 files changed

+399
-192
lines changed

3 files changed

+399
-192
lines changed

compiler/rustc_smir/src/rustc_internal/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ pub fn generator_def(did: DefId) -> stable_mir::ty::GeneratorDef {
4747
with_tables(|t| t.generator_def(did))
4848
}
4949

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+
5058
impl<'tcx> Tables<'tcx> {
5159
pub fn item_def_id(&self, item: &stable_mir::CrateItem) -> DefId {
5260
self.def_ids[item.0]
@@ -76,6 +84,14 @@ impl<'tcx> Tables<'tcx> {
7684
stable_mir::ty::GeneratorDef(self.create_def_id(did))
7785
}
7886

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+
7995
fn create_def_id(&mut self, did: DefId) -> stable_mir::DefId {
8096
// FIXME: this becomes inefficient when we have too many ids
8197
for (i, &d) in self.def_ids.iter().enumerate() {

0 commit comments

Comments
 (0)