Skip to content

#[deriving(Deref)] for newtype structs #14047

Closed
@lilyball

Description

@lilyball

The deriving machinery should support #[deriving(Deref)] on newtype structs. Originally newtype structs could always be deref'd to return the wrapped type, and it's useful to be able to opt back into that behavior on a per-struct basis.

Deriving Deref should also derive DerefMut.

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