Regression test added for an async ICE.
This commit is contained in:
parent
7dbba3d03c
commit
6dd2a857aa
27
src/test/run-pass/issues/issue-57084-async-await.rs
Normal file
27
src/test/run-pass/issues/issue-57084-async-await.rs
Normal file
@ -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() {}
|
Loading…
x
Reference in New Issue
Block a user