rust/tests/ui/async-await/async-drop/auxiliary/async-drop-dep.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
521 B
Rust
Raw Permalink Normal View History

//@ edition:2021
#![feature(async_drop)]
#![allow(incomplete_features)]
pub struct HasDrop;
impl Drop for HasDrop{
fn drop(&mut self) {
println!("Sync drop");
}
}
pub struct MongoDrop;
impl MongoDrop {
pub async fn new() -> Result<Self, HasDrop> {
Ok(Self)
}
}
impl Drop for MongoDrop{
fn drop(&mut self) {
println!("Sync drop");
}
}
impl std::future::AsyncDrop for MongoDrop {
async fn drop(self: std::pin::Pin<&mut Self>) {
println!("Async drop");
}
}