Skip to main content

offset_of_container

Function offset_of_container 

Source
pub(crate) fn offset_of_container<'tcx>(
    tcx: TyCtxt<'tcx>,
    constant: &Const<'tcx>,
) -> Option<Ty<'tcx>>
Expand description

If constant is a promoted offset_of!(Container, field) constant (an unevaluated Const whose body is a call to the offset_of intrinsic), return the container type.

Used by the verifier to recognise byte_add(offset_of!(Container, ..)) and prove the resulting pointer stays within the container allocation.