AccessDepth in rustc_borrowck - Rust (original) (raw)

pub(crate) enum AccessDepth {
    Shallow(Option<ArtificialField>),
    Deep,
    Drop,
}

§

From the RFC: “A shallow access means that the immediate fields reached at P are accessed, but references or pointers found within are not dereferenced. Right now, the only access that is shallow is an assignment like x = ...;, which would be a shallow write of x.”

§

From the RFC: “A deep access means that all data reachable through the given place may be invalidated or accesses by this action.”

§

Access is Deep only when there is a Drop implementation that can reach the data behind the reference.

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 1 byte

Size for each variant: