-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression test added for an async ICE.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |