about summary refs log tree commit diff
path: root/tests/ui/async-await/async-drop/async-without-sync.rs
blob: 8a748636cc783c015dcd1d09bb68423121e1c444 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ edition: 2024
#![feature(async_drop)]
#![allow(incomplete_features)]
#![crate_type = "lib"]

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

async fn foo() {
    let _st = St;
}

struct St;

impl AsyncDrop for St { //~ ERROR: `AsyncDrop` impl without `Drop` impl
    async fn drop(self: Pin<&mut Self>) {
        println!("123");
    }
}