forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#61818 - tmandry:issue-60709-test, r=cramertj
Issue rust-lang#60709 test Adds a test for rust-lang#60709, which was fixed as part of rust-lang#59897. r? @cramertj
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/test/run-pass/async-fn-size.rs → ...est/run-pass/async-await/async-fn-size.rs
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
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,28 @@ | ||
// This used to compile the future down to ud2, due to uninhabited types being | ||
// handled incorrectly in generators. | ||
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018 | ||
|
||
#![feature(async_await, await_macro)] | ||
#![allow(unused)] | ||
|
||
use std::future::Future; | ||
use std::task::Poll; | ||
use std::task::Context; | ||
use std::pin::Pin; | ||
use std::rc::Rc; | ||
|
||
struct Never(); | ||
impl Future for Never { | ||
type Output = (); | ||
fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> { | ||
Poll::Pending | ||
} | ||
} | ||
|
||
fn main() { | ||
let fut = async { | ||
let _rc = Rc::new(()); // Also crashes with Arc | ||
await!(Never()); | ||
}; | ||
let _bla = fut; // Moving the future is required. | ||
} |