# Destructuring Droppable structs

**URL:** https://internals.rust-lang.org/t/destructuring-droppable-structs/20993
**Category:** language design
**Created:** [June 8, 2024, 10:36am UTC](https://internals.rust-lang.org/t/destructuring-droppable-structs/20993 "2024-06-08T10:36:14Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Jules-Bertholet](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jules-bertholet/32/10671_2.png) [@Jules-Bertholet](https://internals.rust-lang.org/u/Jules-Bertholet)
#### Post date: [June 9, 2024, 2:33am UTC](https://internals.rust-lang.org/t/destructuring-droppable-structs/20993/4 "2024-06-09T02:33:24Z")

</div>

As discussed in the [Internals thread](https://internals.rust-lang.org/t/move-out-of-deref-for-manuallydrop/19216/) for this RFC, the issue with "just don't call `Drop` upon partial move" is that whether an assignment is a partial move or not depends on whether the field type is `Copy`. And that can change in any minor version, and can also depend on lifetimes, which aren't allowed to influence monomorphization:

```rust
#[derive(Clone)]
struct Foo<'a>(&'a ());

impl Copy for Foo<'static> {}

struct Bar<'a>(Foo<'a>);

impl<'a> Drop for Bar<'a> {
    fn drop(&mut self) {
        println!("goodbye world");
    }
}

fn do_thing<'a>(bar: Bar<'a>) {
    drop(bar.0); // This is a move only when `'a` is not `'static`
}

```

(interestingly, it seems the compiler has a bug here: [Implementing `Copy` can be a breaking change · Issue #126179 · rust-lang/rust · GitHub](https://github.com/rust-lang/rust/issues/126179))

---

_[View the full topic](https://internals.rust-lang.org/t/destructuring-droppable-structs/20993)._
