Async closures will move params into the future always
This commit is contained in:
parent
8bb1eaee64
commit
f1ee076f81
10 changed files with 41 additions and 89 deletions
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue