Struct rustc::ty::Binder [] [src]

pub struct Binder<T>(pub T);
🔬 This is a nightly-only experimental API. (rustc_private)

Binder is a binder for higher-ranked lifetimes. It is part of the compiler's representation for things like for<'a> Fn(&'a isize) (which would be represented by the type PolyTraitRef == Binder<TraitRef>). Note that when we skolemize, instantiate, erase, or otherwise "discharge" these bound regions, we change the type from Binder<T> to just T (see e.g. liberate_late_bound_regions).

Methods

impl<'a, 'gcx, 'tcx> Binder<ExistentialPredicate<'tcx>>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'tcx> Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

impl<T> Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Skips the binder and returns the "bound" value. This is a risky thing to do because it's easy to get confused about debruijn indices and the like. It is usually better to discharge the binder using no_late_bound_regions or replace_late_bound_regions or something like that. skip_binder is only valid when you are either extracting data that has nothing to do with bound regions, you are doing some sort of test that does not involve bound regions, or you are being very careful about your depth accounting.

Some examples where skip_binder is reasonable: - extracting the def-id from a PolyTraitRef; - comparing the self type of a PolyTraitRef to see if it is equal to a type parameter X, since the type X does not reference any regions

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

Trait Implementations

impl<'tcx, T: Relate<'tcx>> Relate<'tcx> for Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'tcx, T: Lift<'tcx>> Lift<'tcx> for Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (rustc_private)

🔬 This is a nightly-only experimental API. (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<T: Copy> Copy for Binder<T>
[src]

impl<T: Clone> Clone for Binder<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for Binder<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Eq> Eq for Binder<T>
[src]

impl<T: Hash> Hash for Binder<T>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<T: Debug> Debug for Binder<T>
[src]

Formats the value using the given formatter.

impl<T: Encodable> Encodable for Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io

impl<T: Decodable> Decodable for Binder<T>
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

deprecated in favor of rustc-serialize on crates.io

impl<'tcx> Display for Binder<&'tcx Slice<ExistentialPredicate<'tcx>>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<TraitRef<'tcx>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<TraitPredicate<'tcx>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<EquatePredicate<'tcx>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<ProjectionPredicate<'tcx>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<OutlivesPredicate<Ty<'tcx>, &'tcx Region>>
[src]

Formats the value using the given formatter. Read more

impl<'tcx> Display for Binder<OutlivesPredicate<&'tcx Region, &'tcx Region>>
[src]

Formats the value using the given formatter. Read more