summary refs log tree commit diff
path: root/src/test/ui/generator/issue-57017.rs
blob: 1223a3037abc7e6bb3713fff2b867cd97bbf9ef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// check-pass
// compile-flags: -Zdrop-tracking
#![feature(generators, negative_impls)]

struct Client;

impl !Sync for Client {}

fn status(_client_status: &Client) -> i16 {
    200
}

fn assert_send<T: Send>(_thing: T) {}

// This is the same bug as issue 57017, but using yield instead of await
fn main() {
    let client = Client;
    let g = move || match status(&client) {
        _status => yield,
    };
    assert_send(g);
}