Skip to content

Commit ffdabb4

Browse files
committed
Add test case for issue rust-lang#57017
1 parent bc2c073 commit ffdabb4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/test/ui/generator/issue-57017.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// check-pass
2+
#![feature(generators, negative_impls)]
3+
4+
struct Client;
5+
6+
impl !Sync for Client {}
7+
8+
fn status(_client_status: &Client) -> i16 {
9+
200
10+
}
11+
12+
fn assert_send<T: Send>(_thing: T) {}
13+
14+
// This is the same bug as issue 57017, but using yield instead of await
15+
fn main() {
16+
let client = Client;
17+
let g = move || {
18+
match status(&client) {
19+
_status => yield,
20+
}
21+
};
22+
assert_send(g);
23+
}

0 commit comments

Comments
 (0)