Skip to content

Commit

Permalink
Add test case for issue rust-lang#57017
Browse files Browse the repository at this point in the history
  • Loading branch information
eholk committed Sep 13, 2021
1 parent bc2c073 commit ffdabb4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/ui/generator/issue-57017.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// check-pass
#![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);
}

0 comments on commit ffdabb4

Please sign in to comment.