rust/tests/ui/async-await/drop-and-assign.rs
2023-09-23 13:34:07 +00:00

20 lines
268 B
Rust

// edition:2021
// compile-flags: -Zdrop-tracking
// build-pass
struct A;
impl Drop for A { fn drop(&mut self) {} }
pub async fn f() {
let mut a = A;
a = A;
drop(a);
async {}.await;
}
fn assert_send<T: Send>(_: T) {}
fn main() {
let _ = f();
}