Skip to main content

raw_ptr_with_size

Function raw_ptr_with_size 

Source
fn raw_ptr_with_size<'genv, 'tcx>(
    genv: GlobalEnv<'genv, 'tcx>,
    kind: &RawPtrKind,
    ctor: SubsetTyCtor,
    infcx: &InferCtxt<'_, 'genv, 'tcx>,
    def_id: LocalDefId,
) -> Result<Ty, CheckerError>
Expand description

Converts a reference into a raw-ptr, tracking size etc.

For types that do implement Sized: &mut T => *mut{p: p.size == T::size_of() && p.base == p.addr && p.addr % T::align_of() == 0 && p.addr != 0} T

For types that do not implement Sized: &mut T => *mut{p.base == p.addr && p.addr != 0} T

see test fn ref_to_ptr_read in crates/flux/tests/tests/with_deps/pos/extern_specs/flux_core_ptr01.rs