Enum rustc::ty::layout::SizeSkeleton
[−]
[src]
pub enum SizeSkeleton<'tcx> { Known(Size), Pointer { non_zero: bool, tail: 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?
Type size "skeleton", i.e. the only information determining a type's size. While this is conservative, (aside from constant sizes, only pointers, newtypes thereof and null pointer optimized enums are allowed), it is enough to statically check common usecases of transmute.
Variants
Known(Size)
🔬 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?
Any statically computable Layout.
Pointer
🔬 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?
A potentially-fat pointer.
Fields of Pointer
non_zero: bool | 🔬 This is a nightly-only experimental API. ( |
tail: Ty<'tcx> | 🔬 This is a nightly-only experimental API. ( |
Methods
impl<'a, 'tcx> SizeSkeleton<'tcx>
[src]
pub fn compute(
ty: Ty<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>
) -> Result<SizeSkeleton<'tcx>, LayoutError<'tcx>>
[src]
ty: Ty<'tcx>,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ParamEnv<'tcx>
) -> Result<SizeSkeleton<'tcx>, LayoutError<'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 same_size(self, other: SizeSkeleton) -> 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?
Trait Implementations
impl<'tcx> Copy for SizeSkeleton<'tcx>
[src]
impl<'tcx> Clone for SizeSkeleton<'tcx>
[src]
fn clone(&self) -> SizeSkeleton<'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