mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add long error explanation for E0708 #61137
Refactor code as per the suggestions Refacotor code provide edition support
This commit is contained in:
parent
2113659479
commit
26fdde994d
@ -393,6 +393,7 @@ E0703: include_str!("./error_codes/E0703.md"),
|
|||||||
E0704: include_str!("./error_codes/E0704.md"),
|
E0704: include_str!("./error_codes/E0704.md"),
|
||||||
E0705: include_str!("./error_codes/E0705.md"),
|
E0705: include_str!("./error_codes/E0705.md"),
|
||||||
E0706: include_str!("./error_codes/E0706.md"),
|
E0706: include_str!("./error_codes/E0706.md"),
|
||||||
|
E0708: include_str!("./error_codes/E0708.md"),
|
||||||
E0710: include_str!("./error_codes/E0710.md"),
|
E0710: include_str!("./error_codes/E0710.md"),
|
||||||
E0712: include_str!("./error_codes/E0712.md"),
|
E0712: include_str!("./error_codes/E0712.md"),
|
||||||
E0713: include_str!("./error_codes/E0713.md"),
|
E0713: include_str!("./error_codes/E0713.md"),
|
||||||
@ -605,8 +606,6 @@ E0751: include_str!("./error_codes/E0751.md"),
|
|||||||
E0696, // `continue` pointing to a labeled block
|
E0696, // `continue` pointing to a labeled block
|
||||||
// E0702, // replaced with a generic attribute input check
|
// E0702, // replaced with a generic attribute input check
|
||||||
// E0707, // multiple elided lifetimes used in arguments of `async fn`
|
// E0707, // multiple elided lifetimes used in arguments of `async fn`
|
||||||
E0708, // `async` non-`move` closures with parameters are not currently
|
|
||||||
// supported
|
|
||||||
// E0709, // multiple different lifetimes used in arguments of `async fn`
|
// E0709, // multiple different lifetimes used in arguments of `async fn`
|
||||||
E0711, // a feature has been declared with conflicting stability attributes
|
E0711, // a feature has been declared with conflicting stability attributes
|
||||||
E0717, // rustc_promotable without stability attribute
|
E0717, // rustc_promotable without stability attribute
|
||||||
|
26
src/librustc_error_codes/error_codes/E0708.md
Normal file
26
src/librustc_error_codes/error_codes/E0708.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
`async` non-`move` closures with parameters are currently not supported.
|
||||||
|
|
||||||
|
Erroneous code example:
|
||||||
|
|
||||||
|
```compile_fail,edition2018
|
||||||
|
#![feature(async_closure)]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let add_one = async |num: u8| { // error!
|
||||||
|
num + 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
`async` with non-move is currently not supported with the current
|
||||||
|
version, you can use successfully by using move:
|
||||||
|
|
||||||
|
```edition2018
|
||||||
|
#![feature(async_closure)]
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let add_one = async move |num: u8| { // ok!
|
||||||
|
num + 1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
@ -8,3 +8,4 @@ LL | let _ = async |x: u8| {};
|
|||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0708`.
|
||||||
|
Loading…
Reference in New Issue
Block a user