Struct rustc::ty::layout::TyLayout
[−]
[src]
pub struct TyLayout<'tcx> { pub ty: Ty<'tcx>, // some fields omitted }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
The details of the layout of a type, alongside the type itself. Provides various type traversal APIs (e.g. recursing into fields).
Note that the details are NOT guaranteed to always be identical
to those obtained from layout_of(ty)
, as we need to produce
layouts for which Rust types do not exist, such as enum variants
or synthetic fields of enums (i.e. discriminants) and fat pointers.
Fields
ty: Ty<'tcx>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a, 'tcx> TyLayout<'tcx>
[src]
pub fn for_variant<C>(&self, cx: C, variant_index: usize) -> Self where
C: LayoutOf<Ty<'tcx>> + HasTyCtxt<'tcx>,
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
[src]
C: LayoutOf<Ty<'tcx>> + HasTyCtxt<'tcx>,
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn field<C>(&self, cx: C, i: usize) -> C::TyLayout where
C: LayoutOf<Ty<'tcx>> + HasTyCtxt<'tcx>,
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
[src]
C: LayoutOf<Ty<'tcx>> + HasTyCtxt<'tcx>,
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn is_unsized(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if the layout corresponds to an unsized type.
pub fn is_packed(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if the fields of the layout are packed.
pub fn is_zst(&self) -> bool
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Returns true if the type is a ZST and not unsized.
pub fn size_and_align(&self) -> (Size, Align)
[src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Trait Implementations
impl<'tcx> Copy for TyLayout<'tcx>
[src]
impl<'tcx> Clone for TyLayout<'tcx>
[src]
fn clone(&self) -> TyLayout<'tcx>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more