Skip to content

Commit

Permalink
Regression test added for an async ICE.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilescope committed Mar 4, 2019
1 parent 7dbba3d commit 6dd2a85
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/run-pass/issues/issue-57084-async-await.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This issue reproduces an ICE on compile (E.g. fails on 2018-12-19 nightly).
// run-pass
// edition:2018
#![feature(async_await,futures_api,await_macro,generators)]

pub struct Foo;

impl Foo {
async fn with<'a, F, R>(&'a self, f: F) -> R
where F: Fn() -> R + 'a,
{
loop {
match f() {
_ => yield,
}
}
}

pub async fn run<'a>(&'a self, data: &'a [u8])
{
await!(self.with(move || {
println!("{:p}", data);
}))
}
}

fn main() {}

0 comments on commit 6dd2a85

Please sign in to comment.