1
Fork 0

Async closures will move params into the future always

This commit is contained in:
Michael Goulet 2024-01-14 23:12:46 +00:00
parent 8bb1eaee64
commit f1ee076f81
10 changed files with 41 additions and 89 deletions

View file

@ -1,12 +1,14 @@
#### Note: this error code is no longer emitted by the compiler.
`async` non-`move` closures with parameters are currently not supported.
Erroneous code example:
```compile_fail,edition2018,E0708
```edition2018
#![feature(async_closure)]
fn main() {
let add_one = async |num: u8| { // error!
let add_one = async |num: u8| {
num + 1
};
}