# Pre-pre-RFC: \`NoDrop\` marker trait

**URL:** <https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682>\
**Category:** language design\
**Created:** [November 28, 2021, 5:09pm UTC](https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682 "2021-11-28T17:09:18Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![earthengine](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/earthengine/32/2577_2.png) [@earthengine](https://internals.rust-lang.org/u/earthengine)\
**Post date:** [December 25, 2021, 4:17am UTC](https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682/20 "2021-12-25T04:17:38Z")

</div>

I have an alternative solution

> [@Christmas proposal: "Don't call" annotation](https://internals.rust-lang.org/t/christmas-proposal-dont-call-annotation/15851):
>
> Marry Christmas to you all. There are two different motivations lead to this proposal. One is in this existing proposal: [https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682/20](https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682/20) Me, and the author of the post above wanted to have a way to say "this object cannot be dropped unless you have done the check that it is a good time to drop it". My precise challenge is that the object may have active reference leaked so it may not in a safe status to be dropped. To write unsafe co…

With this we don't use a marker trait, instead we have a special annotation, so we can write our own marker object (line `PhantomPinned`).

```rust
struct PhantomNoDrop;
impl Drop for PhantomNoDrop {
    #[do_not_call]
    fn drop(&mut self) { unreachable!() }
}

```

With this any type that in its generated drop clue cannot call this `drop` implementation otherwise the compiler will complain.

---

_[View the full topic](https://internals.rust-lang.org/t/pre-pre-rfc-nodrop-marker-trait/15682)._
