Closed
Description
I tried this code:
#[tokio::main]
async fn main() {
Ok(())
}
I expected to see this happen: Type error reported on Ok(())
Instead, this happened: Got this diagnostic:
error[E0308]: mismatched types
--> src/main.rs:1:1
|
1 | #[tokio::main]
| ^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
| |
| expected `()`, found enum `std::result::Result`
|
= note: expected unit type `()`
found enum `std::result::Result<(), _>`
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
Meta
rustc --version --verbose
:
rustc 1.45.0-nightly (1836e3b42 2020-05-06)
binary: rustc
commit-hash: 1836e3b42a5b2f37fd79104eedbe8f48a5afdee6
commit-date: 2020-05-06
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0