Skip to content

A better way to denote noncopyable types #4069

Closed
@bstrie

Description

@bstrie

In the past the way to tell the compiler that a struct wasn't copyable was to stick an empty drop {} block at the end of it. This was hacky and non-obvious, but at least it was concise. But with the Drop trait this now expands to impl Foo : Drop { fn finalize(&self) {} }, which is rather unfortunate. A #[noncopyable] attribute that expanded to the above would be clearer and less verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions