Skip to content

Document that null is 0 #116895

Description

@joshlf

This has come up in two places recently: #115333 (comment) and #116675 (comment).

We should do the following:

  • On ptr::null(), document that ptr::null() is equivalent to 0usize as *const _
  • Either before or after it lands, update the text in #116675 to document that "allocated objects" cannot contain the 0 address (alternatively, if that PR lands with text that says that an allocated object cannot contain the "null" address, update the text to mention that null is equal to 0)

Are there other places we should update too?

cc @the8472 @tmandry @RalfJung

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libs-api[DEPRECATED; DO NOT USE]T-opsemRelevant to the opsem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions