Skip to content

Commit c99a240

Browse files
authored
Rollup merge of rust-lang#58918 - gilescope:async-await-issue-testcase, r=petrochenkov
Regression test added for an async ICE. Regression test for rust-lang#57084 (as suggested in issue).
2 parents d9c6908 + 143e7d5 commit c99a240

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This issue reproduces an ICE on compile (E.g. fails on 2018-12-19 nightly).
2+
// "cannot relate bound region: ReLateBound(DebruijnIndex(1), BrAnon(1)) <= '_#1r"
3+
// run-pass
4+
// edition:2018
5+
#![feature(generators,generator_trait)]
6+
use std::ops::Generator;
7+
8+
fn with<F>(f: F) -> impl Generator<Yield=(), Return=()>
9+
where F: Fn() -> ()
10+
{
11+
move || {
12+
loop {
13+
match f() {
14+
_ => yield,
15+
}
16+
}
17+
}
18+
}
19+
20+
fn main() {
21+
let data = &vec![1];
22+
|| {
23+
let _to_pin = with(move || println!("{:p}", data));
24+
loop {
25+
yield
26+
}
27+
};
28+
}

0 commit comments

Comments
 (0)