Skip to content

Commit 6dd2a85

Browse files
committed
Regression test added for an async ICE.
1 parent 7dbba3d commit 6dd2a85

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// This issue reproduces an ICE on compile (E.g. fails on 2018-12-19 nightly).
2+
// run-pass
3+
// edition:2018
4+
#![feature(async_await,futures_api,await_macro,generators)]
5+
6+
pub struct Foo;
7+
8+
impl Foo {
9+
async fn with<'a, F, R>(&'a self, f: F) -> R
10+
where F: Fn() -> R + 'a,
11+
{
12+
loop {
13+
match f() {
14+
_ => yield,
15+
}
16+
}
17+
}
18+
19+
pub async fn run<'a>(&'a self, data: &'a [u8])
20+
{
21+
await!(self.with(move || {
22+
println!("{:p}", data);
23+
}))
24+
}
25+
}
26+
27+
fn main() {}

0 commit comments

Comments
 (0)