Skip to content

Commit 0c301e9

Browse files
committed
Deduplicate GenericPredicates
1 parent 17ffb59 commit 0c301e9

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ impl<'tcx> Context for Tables<'tcx> {
108108
generics.stable(self)
109109
}
110110

111-
fn predicates_of(&mut self, def_id: stable_mir::DefId) -> stable_mir::GenericPredicates {
111+
fn predicates_of(&mut self, def_id: stable_mir::DefId) -> stable_mir::ty::GenericPredicates {
112112
let def_id = self[def_id];
113113
let ty::GenericPredicates { parent, predicates } = self.tcx.predicates_of(def_id);
114-
stable_mir::GenericPredicates {
114+
stable_mir::ty::GenericPredicates {
115115
parent: parent.map(|did| self.trait_def(did)),
116116
predicates: predicates
117117
.iter()

compiler/rustc_smir/src/stable_mir/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::cell::Cell;
1616
use crate::rustc_smir::Tables;
1717

1818
use self::ty::{
19-
Generics, ImplDef, ImplTrait, PredicateKind, Span, TraitDecl, TraitDef, Ty, TyKind,
19+
GenericPredicates, Generics, ImplDef, ImplTrait, Span, TraitDecl, TraitDef, Ty, TyKind,
2020
};
2121

2222
pub mod mir;
@@ -41,12 +41,6 @@ pub type TraitDecls = Vec<TraitDef>;
4141
/// A list of impl trait decls.
4242
pub type ImplTraitDecls = Vec<ImplDef>;
4343

44-
/// A list of predicates.
45-
pub struct GenericPredicates {
46-
pub parent: Option<TraitDef>,
47-
pub predicates: Vec<(PredicateKind, Span)>,
48-
}
49-
5044
/// Holds information about a crate.
5145
#[derive(Clone, PartialEq, Eq, Debug)]
5246
pub struct Crate {

compiler/rustc_smir/src/stable_mir/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ pub struct GenericParamDef {
499499
}
500500

501501
pub struct GenericPredicates {
502-
pub parent: Option<DefId>,
503-
pub predicates: Vec<PredicateKind>,
502+
pub parent: Option<TraitDef>,
503+
pub predicates: Vec<(PredicateKind, Span)>,
504504
}
505505

506506
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)