[][src]Struct rustc::ty::List

#[repr(C)]
pub struct List<T> {
    len: usize,
    data: [T; 0],
    opaque: OpaqueListContents,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A wrapper for slices with the additional invariant that the slice is interned and no other slice with the same contents can exist in the same context. This means we can use pointer for both equality comparisons and hashing. Note: Slice was already taken by the Ty.

Fields

len: usize
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

data: [T; 0]
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

opaque: OpaqueListContents
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Methods

impl<'a, 'tcx> List<GenericArg<'tcx>>[src]

pub fn as_closure(&'a self) -> ClosureSubsts<'a>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Interpret these substitutions as the substitutions of a closure type. Closure substitutions have a particular structure controlled by the compiler that encodes information like the signature and closure kind; see ty::ClosureSubsts struct for more comments.

pub fn as_generator(&'tcx self) -> GeneratorSubsts<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Interpret these substitutions as the substitutions of a generator type. Closure substitutions have a particular structure controlled by the compiler that encodes information like the signature and generator kind; see ty::GeneratorSubsts struct for more comments.

pub fn identity_for_item(tcx: TyCtxt<'tcx>, def_id: DefId) -> SubstsRef<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a InternalSubsts that maps each generic parameter to itself.

pub fn bound_vars_for_item(tcx: TyCtxt<'tcx>, def_id: DefId) -> SubstsRef<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a InternalSubsts that maps each generic parameter to a higher-ranked var bound at index 0. For types, we use a BoundVar index equal to the type parameter index. For regions, we use the BoundRegion::BrNamed variant (which has a DefId).

pub fn for_item<F>(
    tcx: TyCtxt<'tcx>,
    def_id: DefId,
    mk_kind: F
) -> SubstsRef<'tcx> where
    F: FnMut(&GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a InternalSubsts for generic parameter definitions, by calling closures to obtain each kind. The closures get to observe the InternalSubsts as they're being built, which can be used to correctly substitute defaults of generic parameters.

pub fn extend_to<F>(
    &self,
    tcx: TyCtxt<'tcx>,
    def_id: DefId,
    mk_kind: F
) -> SubstsRef<'tcx> where
    F: FnMut(&GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn fill_item<F>(
    substs: &mut SmallVec<[GenericArg<'tcx>; 8]>,
    tcx: TyCtxt<'tcx>,
    defs: &Generics,
    mk_kind: &mut F
) where
    F: FnMut(&GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn fill_single<F>(
    substs: &mut SmallVec<[GenericArg<'tcx>; 8]>,
    defs: &Generics,
    mk_kind: &mut F
) where
    F: FnMut(&GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, 
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn is_noop(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn types(&'a self) -> impl DoubleEndedIterator<Item = Ty<'tcx>> + 'a[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn regions(&'a self) -> impl DoubleEndedIterator<Item = Region<'tcx>> + 'a[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn consts(
    &'a self
) -> impl DoubleEndedIterator<Item = &'tcx Const<'tcx>> + 'a
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn non_erasable_generics(
    &'a self
) -> impl DoubleEndedIterator<Item = GenericArgKind<'tcx>> + 'a
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn type_at(&self, i: usize) -> Ty<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn region_at(&self, i: usize) -> Region<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn const_at(&self, i: usize) -> &'tcx Const<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn type_for_def(&self, def: &GenericParamDef) -> GenericArg<'tcx>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn rebase_onto(
    &self,
    tcx: TyCtxt<'tcx>,
    source_ancestor: DefId,
    target_substs: SubstsRef<'tcx>
) -> SubstsRef<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Transform from substitutions for a child of source_ancestor (e.g., a trait or impl) to substitutions for the same child in a different item, with target_substs as the base for the target impl/trait, with the source child-specific parameters (e.g., method parameters) on top of that base.

pub fn truncate_to(
    &self,
    tcx: TyCtxt<'tcx>,
    generics: &Generics
) -> SubstsRef<'tcx>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx> List<ExistentialPredicate<'tcx>>[src]

pub fn principal(&self) -> Option<ExistentialTraitRef<'tcx>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the "principal DefId" of this set of existential predicates.

A Rust trait object type consists (in addition to a lifetime bound) of a set of trait bounds, which are separated into any number of auto-trait bounds, and at most one non-auto-trait bound. The non-auto-trait bound is called the "principal" of the trait object.

Only the principal can have methods or type parameters (because auto traits can have neither of them). This is important, because it means the auto traits can be treated as an unordered set (methods would force an order for the vtable, while relating traits with type parameters without knowing the order to relate them in is a rather non-trivial task).

For example, in the trait object dyn fmt::Debug + Sync, the principal bound is Some(fmt::Debug), while the auto-trait bounds are the set {Sync}.

It is also possible to have a "trivial" trait object that consists only of auto traits, with no principal - for example, dyn Send + Sync. In that case, the set of auto-trait bounds is {Send, Sync}, while there is no principal. These trait objects have a "trivial" vtable consisting of just the size, alignment, and destructor.

pub fn principal_def_id(&self) -> Option<DefId>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn projection_bounds<'a>(
    &'a self
) -> impl Iterator<Item = ExistentialProjection<'tcx>> + 'a
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn auto_traits<'a>(&'a self) -> impl Iterator<Item = DefId> + 'a[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<T: Copy> List<T>[src]

fn from_arena<'tcx>(arena: &'tcx Arena<'tcx>, slice: &[T]) -> &'tcx List<T>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<T> List<T>[src]

pub fn empty<'a>() -> &'a List<T>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait Implementations

impl<T> AsRef<[T]> for List<T>[src]

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

impl<T> Deref for List<T>[src]

type Target = [T]

The resulting type after dereferencing.

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

impl<'tcx> Display for &'tcx List<Ty<'tcx>>[src]

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

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

impl<T> Hash for List<T>[src]

impl<'a, 'tcx, T> HashStable<StableHashingContext<'a>> for &'tcx List<T> where
    T: HashStable<StableHashingContext<'a>>, 
[src]

impl<'a, T> IntoIterator for &'a List<T>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = <&'a [T] as IntoIterator>::IntoIter

Which kind of iterator are we turning this into?

impl<'a, 'tcx> Lift<'tcx> for &'a List<Goal<'a>>[src]

type Lifted = &'tcx List<Goal<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<Clause<'a>>[src]

type Lifted = &'tcx List<Clause<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<Ty<'a>>[src]

type Lifted = &'tcx List<Ty<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<ExistentialPredicate<'a>>[src]

type Lifted = &'tcx List<ExistentialPredicate<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<Predicate<'a>>[src]

type Lifted = &'tcx List<Predicate<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<CanonicalVarInfo>[src]

type Lifted = &'tcx List<CanonicalVarInfo>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<ProjectionKind>[src]

type Lifted = &'tcx List<ProjectionKind>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a, 'tcx> Lift<'tcx> for &'a List<GenericArg<'a>>[src]

type Lifted = &'tcx List<GenericArg<'tcx>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<T> Ord for List<T> where
    T: Ord
[src]

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

impl<T> PartialOrd<List<T>> for List<T> where
    T: PartialOrd
[src]

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for &'tcx List<Ty<'tcx>>[src]

type Output = P

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Error = Error

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx, P: Printer<'tcx>> Print<'tcx, P> for &'tcx List<ExistentialPredicate<'tcx>>[src]

type Output = P::DynExistential

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Error = P::Error

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx> Relate<'tcx> for &'tcx List<ExistentialPredicate<'tcx>>[src]

impl<'a, 'tcx> SpecializedDecoder<&'tcx List<&'tcx TyS<'tcx>>> for CacheDecoder<'a, 'tcx>[src]

impl<'a, 'tcx> SpecializedDecoder<&'tcx List<CanonicalVarInfo>> for CacheDecoder<'a, 'tcx>[src]

impl<'a, 'tcx> SpecializedDecoder<&'tcx List<ExistentialPredicate<'tcx>>> for CacheDecoder<'a, 'tcx>[src]

impl<'a, 'tcx> SpecializedDecoder<&'tcx List<GenericArg<'tcx>>> for CacheDecoder<'a, 'tcx>[src]

impl<T: Sync> Sync for List<T>[src]

impl<'a, 'tcx, T> ToStableHashKey<StableHashingContext<'a>> for &'tcx List<T> where
    T: HashStable<StableHashingContext<'a>>, 
[src]

type KeyType = Fingerprint

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<PlaceElem<'tcx>>[src]

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<Goal<'tcx>>[src]

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<ExistentialPredicate<'tcx>>[src]

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<Ty<'tcx>>[src]

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<ProjectionKind>[src]

impl<'tcx> TypeFoldable<'tcx> for &'tcx List<Predicate<'tcx>>[src]

impl<'tcx> UseSpecializedDecodable for &'tcx List<ExistentialPredicate<'tcx>>[src]

impl<'tcx> UseSpecializedDecodable for &'tcx List<Ty<'tcx>>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for List<T>

impl<T> !Send for List<T>

impl<T> !Unpin for List<T>

impl<T> !UnwindSafe for List<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Encodable for T where
    T: UseSpecializedEncodable + ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<E> SpecializationError for E[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]