Skip to content

Commit

Permalink
Auto merge of rust-lang#115211 - spastorino:add-missing-smir-generics…
Browse files Browse the repository at this point in the history
…-of, r=compiler-errors

Add missing high-level stable_mir::generics_of fn

We forgot to add this function in rust-lang#115092, as we have done on rust-lang#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
  • Loading branch information
bors committed Aug 26, 2023
2 parents ac89e16 + 3dd1c6b commit c503527
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_smir/src/stable_mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit c503527

Please sign in to comment.