Skip to content

Validity of Box<T> #145

Open
Open
@RalfJung

Description

@RalfJung

What is the validity invariant of Box<T>? If this was just a library type it would be the same as Unique<T>, which is the same as NonNull<T>. But actually most of the compiler treats Box<T> a lot like a reference, so at least de-facto right now, Box<T> likely has the same validity invariant as &T and &mut T (which is discussed in #76 and #77).

Also see some prior discussion in rust-lang/rust-memory-model#3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-validityTopic: Related to validity invariantsS-pending-designStatus: Resolving this issue requires addressing some open design questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions