Struct rustc_middle::ty::layout::LayoutCx [−][src]
pub struct LayoutCx<'tcx, C> {
pub tcx: C,
pub param_env: ParamEnv<'tcx>,
}
Fields
tcx: C
param_env: ParamEnv<'tcx>
Implementations
fn univariant_uninterned(
&self,
ty: Ty<'tcx>,
fields: &[TyAndLayout<'_>],
repr: &ReprOptions,
kind: StructKind
) -> Result<Layout, LayoutError<'tcx>>
fn generator_saved_local_eligibility(
&self,
info: &GeneratorLayout<'tcx>
) -> (BitSet<GeneratorSavedLocal>, IndexVec<GeneratorSavedLocal, SavedLocalEligibility>)
fn generator_saved_local_eligibility(
&self,
info: &GeneratorLayout<'tcx>
) -> (BitSet<GeneratorSavedLocal>, IndexVec<GeneratorSavedLocal, SavedLocalEligibility>)
Compute the eligibility and assignment of each local.
fn generator_layout(
&self,
ty: Ty<'tcx>,
def_id: DefId,
substs: SubstsRef<'tcx>
) -> Result<&'tcx Layout, LayoutError<'tcx>>
fn generator_layout(
&self,
ty: Ty<'tcx>,
def_id: DefId,
substs: SubstsRef<'tcx>
) -> Result<&'tcx Layout, LayoutError<'tcx>>
Compute the full generator layout.
This is invoked by the layout_of
query to record the final
layout of each type.
fn fn_abi_new_uncached(
&self,
sig: PolyFnSig<'tcx>,
extra_args: &[Ty<'tcx>],
caller_location: Option<Ty<'tcx>>,
codegen_fn_attr_flags: CodegenFnAttrFlags,
force_thin_self_ptr: bool
) -> Result<&'tcx FnAbi<'tcx, Ty<'tcx>>, FnAbiError<'tcx>>
fn fn_abi_adjust_for_abi(
&self,
fn_abi: &mut FnAbi<'tcx, Ty<'tcx>>,
abi: SpecAbi
) -> Result<(), FnAbiError<'tcx>>
Trait Implementations
type LayoutOfResult = Result<TyAndLayout<'tcx>, LayoutError<'tcx>>
type LayoutOfResult = Result<TyAndLayout<'tcx>, LayoutError<'tcx>>
The TyAndLayout
-wrapping type (or TyAndLayout
itself), which will be
returned from layout_of
(see also handle_layout_err
). Read more
fn handle_layout_err(
&self,
err: LayoutError<'tcx>,
_: Span,
_: Ty<'tcx>
) -> LayoutError<'tcx>
fn handle_layout_err(
&self,
err: LayoutError<'tcx>,
_: Span,
_: Ty<'tcx>
) -> LayoutError<'tcx>
Helper used for layout_of
, to adapt tcx.layout_of(...)
into a
Self::LayoutOfResult
(which does not need to be a Result<...>
). Read more
Span
to use for tcx.at(span)
, from layout_of
.
type LayoutOfResult = Result<TyAndLayout<'tcx>, LayoutError<'tcx>>
type LayoutOfResult = Result<TyAndLayout<'tcx>, LayoutError<'tcx>>
The TyAndLayout
-wrapping type (or TyAndLayout
itself), which will be
returned from layout_of
(see also handle_layout_err
). Read more
Span
to use for tcx.at(span)
, from layout_of
.
fn handle_layout_err(
&self,
err: LayoutError<'tcx>,
_: Span,
_: Ty<'tcx>
) -> LayoutError<'tcx>
fn handle_layout_err(
&self,
err: LayoutError<'tcx>,
_: Span,
_: Ty<'tcx>
) -> LayoutError<'tcx>
Helper used for layout_of
, to adapt tcx.layout_of(...)
into a
Self::LayoutOfResult
(which does not need to be a Result<...>
). Read more
Auto Trait Implementations
impl<'tcx, C> !RefUnwindSafe for LayoutCx<'tcx, C>
impl<'tcx, C> !UnwindSafe for LayoutCx<'tcx, C>
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.