about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-26 00:32:16 +0000
committerbors <bors@rust-lang.org>2023-08-26 00:32:16 +0000
commitc5035271acc7e140893c1dcdb5a83bf4ddf04593 (patch)
tree2819bebbcb40ec6fff7c23688730409c5ed8cf12 /compiler
parentac89e1615d78a9a89bf35047ae4413fcc1c8e875 (diff)
parent3dd1c6bc98c6c26f797527437b7f6195375bfcc6 (diff)
downloadrust-c5035271acc7e140893c1dcdb5a83bf4ddf04593.tar.gz
rust-c5035271acc7e140893c1dcdb5a83bf4ddf04593.zip
Auto merge of #115211 - spastorino:add-missing-smir-generics-of, r=compiler-errors
Add missing high-level stable_mir::generics_of fn

We forgot to add this function in https://github.com/rust-lang/rust/pull/115092, as we have done on https://github.com/rust-lang/rust/pull/115084 and other high level APIs.

At some point I think we should re-organize the structure of the code but this is what we have for now.

r? `@compiler-errors`
Would have assigned `@oli-obk` but he is still on vacations
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_smir/src/stable_mir/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_smir/src/stable_mir/mod.rs b/compiler/rustc_smir/src/stable_mir/mod.rs
index 360f2195c1c..44938eaa035 100644
--- a/compiler/rustc_smir/src/stable_mir/mod.rs
+++ b/compiler/rustc_smir/src/stable_mir/mod.rs
@@ -109,6 +109,10 @@ pub fn trait_impl(trait_impl: &ImplDef) -> ImplTrait {
     with(|cx| cx.trait_impl(trait_impl))
 }
 
+pub fn generics_of(generic_def: &GenericDef) -> Generics {
+    with(|cx| cx.generics_of(generic_def))
+}
+
 pub fn predicates_of(trait_def: &TraitDef) -> GenericPredicates {
     with(|cx| cx.predicates_of(trait_def))
 }