Closed
Description
Code
#[actix_rt::main]
async fn main() -> std::io::Result<()> {}
Current output
error[E0308]: mismatched types
--> src/main.rs:1:1
|
1 | #[actix_rt::main]
| ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
2 | async fn main() -> std::io::Result<()> {}
| ------------------- expected `Result<(), std::io::Error>` because of return type
|
= note: expected enum `Result<(), std::io::Error>`
found unit type `()`
= note: this error originates in the attribute macro `actix_rt::main` (in Nightly builds, run with -Z macro-backtrace for more info)
help: try wrapping the expression in `Ok`
|
1 | Ok(#[actix_rt::main])
| +++ +
For more information about this error, try `rustc --explain E0308`.
Desired output
Wrap the return value in Ok(), not the attribute...
Rationale and extra context
No response
Other cases
No response
Anything else?
rustc 1.68.0-nightly (4c83bd0 2023-01-19)