Skip to content

Commit b54fe76

Browse files
authored
Rollup merge of #114859 - spastorino:add-smir-cx-trait-fns, r=compiler-errors
Add trait related queries to SMIR's rustc_internal r? `@oli-obk`
2 parents 8f1c811 + 826471e commit b54fe76

File tree

1 file changed

+16
-0
lines changed
  • compiler/rustc_smir/src/stable_mir

1 file changed

+16
-0
lines changed

compiler/rustc_smir/src/stable_mir/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,22 @@ pub fn all_local_items() -> CrateItems {
8585
with(|cx| cx.all_local_items())
8686
}
8787

88+
pub fn all_trait_decls() -> TraitDecls {
89+
with(|cx| cx.all_trait_decls())
90+
}
91+
92+
pub fn trait_decl(trait_def: &TraitDef) -> TraitDecl {
93+
with(|cx| cx.trait_decl(trait_def))
94+
}
95+
96+
pub fn all_trait_impls() -> ImplTraitDecls {
97+
with(|cx| cx.all_trait_impls())
98+
}
99+
100+
pub fn trait_impl(trait_impl: &ImplDef) -> ImplTrait {
101+
with(|cx| cx.trait_impl(trait_impl))
102+
}
103+
88104
pub trait Context {
89105
fn entry_fn(&mut self) -> Option<CrateItem>;
90106
/// Retrieve all items of the local crate that have a MIR associated with them.

0 commit comments

Comments
 (0)