Skip to content

Improve documentation of std::ptr::NonNull #48929

Closed
@crlf0710

Description

@crlf0710

This type used to be experimental and internal (when it was called Shared), now that it is finally being stablized (see #27730, #47631), people are complaining that the current document texts are not easy to understand.

Current text *mut T but non-zero and covariant. talks about the covariance, which is not mentioned elsewhere in the libstd docs and the Rust books. (I know it's mentioned in Nomicon but beginners seldom have read it.)

I suggest the docs be either supplemented with concrete explanations or reworked upon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-FFIArea: Foreign function interface (FFI)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-raw-pointersArea: raw pointers, MaybeUninit, NonNullC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.P-mediumMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions