]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0708.md
New upstream version 1.44.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0708.md
1 `async` non-`move` closures with parameters are currently not supported.
2
3 Erroneous code example:
4
5 ```compile_fail,edition2018
6 #![feature(async_closure)]
7
8 fn main() {
9 let add_one = async |num: u8| { // error!
10 num + 1
11 };
12 }
13 ```
14
15 `async` with non-move is currently not supported with the current
16 version, you can use successfully by using move:
17
18 ```edition2018
19 #![feature(async_closure)]
20
21 fn main() {
22 let add_one = async move |num: u8| { // ok!
23 num + 1
24 };
25 }
26 ```