diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2023-08-28 17:39:52 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2023-08-29 08:34:33 -0300 |
| commit | 079e3732cc5b605efdae115a83e1fd21bcdda459 (patch) | |
| tree | b84167212582c57b462b262dea93b162a2c4c484 | |
| parent | 0c301e9d3605b798bfbceb9dfd13bb0897d29d31 (diff) | |
| download | rust-079e3732cc5b605efdae115a83e1fd21bcdda459.tar.gz rust-079e3732cc5b605efdae115a83e1fd21bcdda459.zip | |
Implement generics_of and predicates_of only for TraitDecl for now
| -rw-r--r-- | compiler/rustc_smir/src/stable_mir/ty.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/rustc_smir/src/stable_mir/ty.rs b/compiler/rustc_smir/src/stable_mir/ty.rs index c1739e9c5ac..197e12b1c4f 100644 --- a/compiler/rustc_smir/src/stable_mir/ty.rs +++ b/compiler/rustc_smir/src/stable_mir/ty.rs @@ -135,12 +135,6 @@ impl ImplDef { } } -impl GenericDef { - pub fn generics_of(&self) -> Generics { - with(|cx| cx.generics_of(self.0)) - } -} - #[derive(Clone, Debug)] pub struct GenericArgs(pub Vec<GenericArgKind>); @@ -463,6 +457,16 @@ pub struct TraitDecl { pub deny_explicit_impl: bool, } +impl TraitDecl { + pub fn generics_of(&self) -> Generics { + with(|cx| cx.generics_of(self.def_id.0)) + } + + pub fn predicates_of(&self) -> GenericPredicates { + with(|cx| cx.predicates_of(self.def_id.0)) + } +} + pub type ImplTrait = EarlyBinder<TraitRef>; #[derive(Clone, Debug)] |
