rustc_middle::ty::layout

Trait LayoutOf

Source
pub trait LayoutOf<'tcx>: LayoutOfHelpers<'tcx> {
    // Provided methods
    fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult { ... }
    fn spanned_layout_of(
        &self,
        ty: Ty<'tcx>,
        span: Span,
    ) -> Self::LayoutOfResult { ... }
}
Expand description

Blanket extension trait for contexts that can compute layouts of types.

Provided Methods§

Source

fn layout_of(&self, ty: Ty<'tcx>) -> Self::LayoutOfResult

Computes the layout of a type. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.

Source

fn spanned_layout_of(&self, ty: Ty<'tcx>, span: Span) -> Self::LayoutOfResult

Computes the layout of a type, at span. Note that this implicitly executes in “reveal all” mode, and will normalize the input type.

Implementors§

Source§

impl<'tcx, C: LayoutOfHelpers<'tcx>> LayoutOf<'tcx> for C