-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip over args when determining if coroutine-closure's inner coroutin…
…e consumes its upvars
- Loading branch information
1 parent
a886938
commit 5138586
Showing
2 changed files
with
70 additions
and
13 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
17 changes: 17 additions & 0 deletions
17
tests/ui/async-await/async-closures/non-copy-arg-does-not-force-inner-move.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//@ aux-build:block-on.rs | ||
//@ edition:2021 | ||
//@ build-pass | ||
|
||
#![feature(async_closure)] | ||
|
||
extern crate block_on; | ||
|
||
fn wrapper(f: impl Fn(String)) -> impl async Fn(String) { | ||
async move |s| f(s) | ||
} | ||
|
||
fn main() { | ||
block_on::block_on(async { | ||
wrapper(|who| println!("Hello, {who}!"))(String::from("world")).await; | ||
}); | ||
} |