diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-08-16 08:43:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-16 08:43:52 +0200 |
| commit | b54fe7649488d6677adb7e1f91f4ad049b6ef9df (patch) | |
| tree | e271b4e1737c32d498493bc76a07bf96bdb467ff | |
| parent | 8f1c8116f660eefcd926659b1dec71c46709e114 (diff) | |
| parent | 826471e93bda7a2cbf2213d1cf8f76a2cd77ec2c (diff) | |
| download | rust-b54fe7649488d6677adb7e1f91f4ad049b6ef9df.tar.gz rust-b54fe7649488d6677adb7e1f91f4ad049b6ef9df.zip | |
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`
| -rw-r--r-- | compiler/rustc_smir/src/stable_mir/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_smir/src/stable_mir/mod.rs b/compiler/rustc_smir/src/stable_mir/mod.rs index a74975cefc2..19061742b64 100644 --- a/compiler/rustc_smir/src/stable_mir/mod.rs +++ b/compiler/rustc_smir/src/stable_mir/mod.rs @@ -85,6 +85,22 @@ pub fn all_local_items() -> CrateItems { with(|cx| cx.all_local_items()) } +pub fn all_trait_decls() -> TraitDecls { + with(|cx| cx.all_trait_decls()) +} + +pub fn trait_decl(trait_def: &TraitDef) -> TraitDecl { + with(|cx| cx.trait_decl(trait_def)) +} + +pub fn all_trait_impls() -> ImplTraitDecls { + with(|cx| cx.all_trait_impls()) +} + +pub fn trait_impl(trait_impl: &ImplDef) -> ImplTrait { + with(|cx| cx.trait_impl(trait_impl)) +} + pub trait Context { fn entry_fn(&mut self) -> Option<CrateItem>; /// Retrieve all items of the local crate that have a MIR associated with them. |
