Skip to content

Commit 079e373

Browse files
committed
Implement generics_of and predicates_of only for TraitDecl for now
1 parent 0c301e9 commit 079e373

File tree

1 file changed

+10
-6
lines changed
  • compiler/rustc_smir/src/stable_mir

1 file changed

+10
-6
lines changed

compiler/rustc_smir/src/stable_mir/ty.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,6 @@ impl ImplDef {
135135
}
136136
}
137137

138-
impl GenericDef {
139-
pub fn generics_of(&self) -> Generics {
140-
with(|cx| cx.generics_of(self.0))
141-
}
142-
}
143-
144138
#[derive(Clone, Debug)]
145139
pub struct GenericArgs(pub Vec<GenericArgKind>);
146140

@@ -463,6 +457,16 @@ pub struct TraitDecl {
463457
pub deny_explicit_impl: bool,
464458
}
465459

460+
impl TraitDecl {
461+
pub fn generics_of(&self) -> Generics {
462+
with(|cx| cx.generics_of(self.def_id.0))
463+
}
464+
465+
pub fn predicates_of(&self) -> GenericPredicates {
466+
with(|cx| cx.predicates_of(self.def_id.0))
467+
}
468+
}
469+
466470
pub type ImplTrait = EarlyBinder<TraitRef>;
467471

468472
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)