Skip to content

impl AsyncDrop for &Foo / Pin<Foo> should not compile #143691

@theemathas

Description

@theemathas

The following code currently compiles. Clearly, it should not.

#![feature(async_drop)]

use std::future::AsyncDrop;
use std::pin::Pin;

struct Foo;

impl AsyncDrop for &Foo {
    async fn drop(self: Pin<&mut Self>) {}
}

impl AsyncDrop for Pin<Foo> {
    async fn drop(self: Pin<&mut Self>) {}
}

Meta

Reproducible on the playground with 1.90.0-nightly (2025-07-08 ab68b0fb26485ab1fa69)

@rustbot labels +F-async_drop

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-async_drop`#![feature(async_drop)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions