Enum rustc_trans::middle::ty::PredicateUnstable [-] [+] [src]

pub enum Predicate<'tcx> {
    Trait(Binder<TraitPredicate<'tcx>>),
    Equate(Binder<EquatePredicate<'tcx>>),
    RegionOutlives(Binder<OutlivesPredicate<Region, Region>>),
    TypeOutlives(Binder<OutlivesPredicate<&'tcx TyS<'tcx>, Region>>),
    Projection(Binder<ProjectionPredicate<'tcx>>),
}

Variants

Trait

Corresponds to where Foo : Bar<A,B,C>. Foo here would be the Self type of the trait reference and A, B, and C would be the parameters in the TypeSpace.

Equate

where T1 == T2.

RegionOutlives

where 'a : 'b

TypeOutlives

where T : 'a

Projection

where ::Name == X, approximately. See ProjectionPredicate struct for details.

Methods

impl<'tcx> Predicate<'tcx>

fn subst_supertrait(&self, tcx: &ctxt<'tcx>, trait_ref: &Binder<Rc<TraitRef<'tcx>>>) -> Predicate<'tcx>

Performs a substituion suitable for going from a poly-trait-ref to supertraits that must hold if that poly-trait-ref holds. This is slightly different from a normal substitution in terms of what happens with bound regions. See lengthy comment below for details.

impl<'tcx> Predicate<'tcx>

fn walk_tys(&self) -> IntoIter<&'tcx TyS<'tcx>>

Iterates over the types in this predicate. Note that in all cases this is skipping over a binder, so late-bound regions with depth 0 are bound by the predicate.

fn has_escaping_regions(&self) -> bool

fn to_opt_poly_trait_ref(&self) -> Option<Binder<Rc<TraitRef<'tcx>>>>

Trait Implementations

impl<'tcx> Repr<'tcx> for Predicate<'tcx>

fn repr(&self, tcx: &ctxt<'tcx>) -> String

impl<'tcx> RegionEscape for Predicate<'tcx>

fn has_regions_escaping_depth(&self, depth: u32) -> bool

fn has_escaping_regions(&self) -> bool

impl<'tcx> HasProjectionTypes for Predicate<'tcx>

fn has_projection_types(&self) -> bool

impl<'tcx> ReferencesError for Predicate<'tcx>

fn references_error(&self) -> bool

impl<'tcx> TypeFoldable<'tcx> for Predicate<'tcx>

fn fold_with<F>(&self, folder: &mut F) -> Predicate<'tcx> where F: TypeFolder<'tcx>

impl<'tcx> UserString<'tcx> for Predicate<'tcx>

fn user_string(&self, tcx: &ctxt<'tcx>) -> String

Derived Implementations

impl<'tcx> Debug for Predicate<'tcx>

fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>

impl<'tcx> Hash for Predicate<'tcx>

fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<'tcx> Eq for Predicate<'tcx>

impl<'tcx> PartialEq<Predicate<'tcx>> for Predicate<'tcx>

fn eq(&self, __arg_0: &Predicate<'tcx>) -> bool

fn ne(&self, __arg_0: &Predicate<'tcx>) -> bool

impl<'tcx> Clone for Predicate<'tcx>

fn clone(&self) -> Predicate<'tcx>

fn clone_from(&mut self, source: &Self)