rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

The derivation of the `never` type in JoinHandle failed

Open A4-Tacks opened this issue 1 year ago • 0 comments

rust-analyzer version: rust-analyzer 1.76.0 (07dca48 2024-02-04) and rust-analyzer 1.78.0-nightly (bccb9bb 2024-02-16)

rustc version: rustc 1.76.0 (07dca489a 2024-02-04) and rustc 1.78.0-nightly (bccb9bbb4 2024-02-16)

relevant settings: NONE

example

fn main() {
    use std::thread::spawn;

    fn foo() -> ! {
        panic!()
    }

    // ra: h: JoinHandle<{unknown}>
    // expected: h: JoinHandle<!>
    let h = spawn(|| {
        foo()
    });
    let _ = dbg!(h.join()); // Err(..)
}

A4-Tacks avatar Feb 17 '24 02:02 A4-Tacks