Enum rustc::ty::Predicate
[−]
[src]
pub enum Predicate<'tcx> { Trait(PolyTraitPredicate<'tcx>), Equate(PolyEquatePredicate<'tcx>), RegionOutlives(PolyRegionOutlivesPredicate<'tcx>), TypeOutlives(PolyTypeOutlivesPredicate<'tcx>), Projection(PolyProjectionPredicate<'tcx>), WellFormed(Ty<'tcx>), ObjectSafe(DefId), ClosureKind(DefId, ClosureKind), }
rustc_private
)Variants
Trait(PolyTraitPredicate<'tcx>)
rustc_private
)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 type parameters.
Equate(PolyEquatePredicate<'tcx>)
rustc_private
)where T1 == T2
.
RegionOutlives(PolyRegionOutlivesPredicate<'tcx>)
rustc_private
)where 'a : 'b
TypeOutlives(PolyTypeOutlivesPredicate<'tcx>)
rustc_private
)where T : 'a
Projection(PolyProjectionPredicate<'tcx>)
rustc_private
)where ProjectionPredicate
struct for details.
WellFormed(Ty<'tcx>)
rustc_private
)no syntax: T WF
ObjectSafe(DefId)
rustc_private
)trait must be object-safe
ClosureKind(DefId, ClosureKind)
rustc_private
)No direct syntax. May be thought of as where T : FnFoo<...>
for some substitutions ...
and T being a closure type.
Satisfied (or refuted) once we know the closure's kind.
Methods
impl<'a, 'gcx, 'tcx> Predicate<'tcx>
[src]
fn subst_supertrait(&self,
tcx: TyCtxt<'a, 'gcx, 'tcx>,
trait_ref: &PolyTraitRef<'tcx>)
-> Predicate<'tcx>
tcx: TyCtxt<'a, 'gcx, 'tcx>,
trait_ref: &PolyTraitRef<'tcx>)
-> Predicate<'tcx>
rustc_private
)Performs a substitution 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>
[src]
fn walk_tys(&self) -> IntoIter<Ty<'tcx>>
rustc_private
)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 to_opt_poly_trait_ref(&self) -> Option<PolyTraitRef<'tcx>>
rustc_private
)Trait Implementations
impl<'a, 'tcx> Lift<'tcx> for Predicate<'a>
[src]
type Lifted = Predicate<'tcx>
rustc_private
)fn lift_to_tcx<'b, 'gcx>(&self,
tcx: TyCtxt<'b, 'gcx, 'tcx>)
-> Option<Self::Lifted>
tcx: TyCtxt<'b, 'gcx, 'tcx>)
-> Option<Self::Lifted>
rustc_private
)impl<'tcx> TypeFoldable<'tcx> for Predicate<'tcx>
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn has_regions_escaping_depth(&self, depth: u32) -> bool
rustc_private
)fn has_escaping_regions(&self) -> bool
rustc_private
)fn has_type_flags(&self, flags: TypeFlags) -> bool
rustc_private
)fn has_projection_types(&self) -> bool
rustc_private
)fn references_error(&self) -> bool
rustc_private
)fn has_param_types(&self) -> bool
rustc_private
)fn has_self_ty(&self) -> bool
rustc_private
)fn has_infer_types(&self) -> bool
rustc_private
)fn needs_infer(&self) -> bool
rustc_private
)fn needs_subst(&self) -> bool
rustc_private
)fn has_re_skol(&self) -> bool
rustc_private
)fn has_closure_types(&self) -> bool
rustc_private
)fn has_erasable_regions(&self) -> bool
rustc_private
)fn is_normalized_for_trans(&self) -> bool
rustc_private
)fn is_global(&self) -> bool
rustc_private
)Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more
impl<'tcx> Clone for Predicate<'tcx>
[src]
fn clone(&self) -> Predicate<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'tcx> PartialEq for Predicate<'tcx>
[src]
fn eq(&self, __arg_0: &Predicate<'tcx>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Predicate<'tcx>) -> bool
This method tests for !=
.
impl<'tcx> Eq for Predicate<'tcx>
[src]
impl<'tcx> Hash for Predicate<'tcx>
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<'tcx> Encodable for Predicate<'tcx>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Decodable for Predicate<'tcx>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D)
-> Result<Predicate<'tcx>, __D::Error>
-> Result<Predicate<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io