summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/drop-and-assign.rs
blob: fa3f3303677daa204b6f607faa962a8f4301ca1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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();
}