Skip to content

Elaborate the C-DEREF guideline #257

Open
@NeverGivinUp

Description

@NeverGivinUp

The motivation for the C-DEREF guideline and the potential problems resulting from ignoring it are (imho) not self explaning. The strongest clue I can find is from the guideline being filed in the Predictability section.

Neither the guideline, the doc or the smart pointer section of The Book explicitly define the difference between smart pointers and general applications of the newtype pattern. Outside the std library contributors there does seem to be confusion (see this old reddit thread). Maybe just referencing C-SMART-PTR would suffice.

Ideally the guideline shouldn't just describe what not to do, but what to do instead: When to impl AsRef/AsMut? What other options are there?

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