Skip to content

decide on official naming conventions for ~, @, & and * #6608

Closed
@thestinger

Description

@thestinger

We use really inconsistent naming at the moment: unique/owned/managed pointers/boxes, borrowed/region pointers, unsafe/raw pointers.

Some thoughts on the possibilities:

&:

  • reference - simple, implies that it points at an existing object and talks about semantics rather than implementation and we already have ref and ref mut
  • borrowed pointer - intimidating, but also does a good job conveying that it's a reference to existing memory and it's the defacto name right now

~ and @:

Owned/managed pointer isn't correct since the pointer itself is just a handle - all pointers are owned, but not necessarily what they point at. That's part of why we got into the convention of calling them boxes.

So we should settle on one of these:

  • unique/managed pointer
  • owned/managed box

*:

  • raw pointer
  • unsafe pointer

I think I would be happiest with "reference", "unique pointer", "managed pointer" and "raw pointer" but I'm sure there are other opinions :). I just want to get the documentation consistent with standardized terms....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions