Skip to content

Allow constants with destructors (but don't have them run) #913

Closed
@arielb1

Description

@arielb1

In today's Rust, constants and statics can't contain destructors, and this prevents them from containing things like None : Option<Box<_>>. However, destructors are entirely memory safe, even if they don't get run - they can only leak resources, and this is relatively harmless, as you can't allocate resources in statics.

There's the problem of destructors being used to flush things, but I don't think this will be particularly evil.

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