Skip to content

Uniformly prevent values with destructors from being disassembled/moved out of #4691

Closed
@nikomatsakis

Description

@nikomatsakis

We need to put in place three checks (at least?) to prevent values with destructors from being moved out of:

  • No pattern with by-move bindings that matches a type with a dtor (I think this is implemented)
  • No moving from a subcomponent of a type with a dtor (e.g., x.f where x has a dtor). Right now the borrow checker doesn't allow such moves, but there is no deep reason why it shouldn't, and the rest of the code is kind of setup to allow them whenever borrow checker gives the nod.
  • No moving out of a value with a dtor in FSU: S { a, b, ..c } where c has a dtor, even if this would otherwise be legal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions