Skip to content

RFC: Limit what types can have destructors #4301

Closed
@nikomatsakis

Description

@nikomatsakis

We need some limits on destructors to prevent bugs like bugs like #3167, #3039, #4170. Also to address the various challenges of destructors and finalizers that have been uncovered in other languages.

My current preference is to say that destructors can only be created for sendable types. Or, put another way, destructors should only be able to access owned content. Perhaps this is too extreme, but it's a nice simple rule.

Anyway, I wanted to open a blanket bug for those other bugs, and perhaps to spark some discussion and thought.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-destructorsArea: Destructors (`Drop`, …)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions