Rust-analyzer: Hovering over `return` keyword gives `!`

Created on 24 Jun 2019  路  4Comments  路  Source: rust-analyzer/rust-analyzer

All 4 comments

The return statement never returns to the next statement, so it kinda diverges. Also the following is valid rust:

fn main() {
    let _: Option<u8> = return;
}

My guess is this is also #1508

No, even with #1508 fixed the type of the whole return statement will still be !. Actually I think this is working as intended.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matklad picture matklad  路  3Comments

matklad picture matklad  路  4Comments

Matelasse picture Matelasse  路  3Comments

matklad picture matklad  路  3Comments

csmoe picture csmoe  路  4Comments