mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Deduplicate GenericPredicates
This commit is contained in:
@@ -108,10 +108,10 @@ fn generics_of(&mut self, def_id: stable_mir::DefId) -> stable_mir::ty::Generics
|
||||
generics.stable(self)
|
||||
}
|
||||
|
||||
fn predicates_of(&mut self, def_id: stable_mir::DefId) -> stable_mir::GenericPredicates {
|
||||
fn predicates_of(&mut self, def_id: stable_mir::DefId) -> stable_mir::ty::GenericPredicates {
|
||||
let def_id = self[def_id];
|
||||
let ty::GenericPredicates { parent, predicates } = self.tcx.predicates_of(def_id);
|
||||
stable_mir::GenericPredicates {
|
||||
stable_mir::ty::GenericPredicates {
|
||||
parent: parent.map(|did| self.trait_def(did)),
|
||||
predicates: predicates
|
||||
.iter()
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
use crate::rustc_smir::Tables;
|
||||
|
||||
use self::ty::{
|
||||
Generics, ImplDef, ImplTrait, PredicateKind, Span, TraitDecl, TraitDef, Ty, TyKind,
|
||||
GenericPredicates, Generics, ImplDef, ImplTrait, Span, TraitDecl, TraitDef, Ty, TyKind,
|
||||
};
|
||||
|
||||
pub mod mir;
|
||||
@@ -41,12 +41,6 @@
|
||||
/// A list of impl trait decls.
|
||||
pub type ImplTraitDecls = Vec<ImplDef>;
|
||||
|
||||
/// A list of predicates.
|
||||
pub struct GenericPredicates {
|
||||
pub parent: Option<TraitDef>,
|
||||
pub predicates: Vec<(PredicateKind, Span)>,
|
||||
}
|
||||
|
||||
/// Holds information about a crate.
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
pub struct Crate {
|
||||
|
||||
@@ -499,8 +499,8 @@ pub struct GenericParamDef {
|
||||
}
|
||||
|
||||
pub struct GenericPredicates {
|
||||
pub parent: Option<DefId>,
|
||||
pub predicates: Vec<PredicateKind>,
|
||||
pub parent: Option<TraitDef>,
|
||||
pub predicates: Vec<(PredicateKind, Span)>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user