You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
VSC: rust-analyzer version: 0.3.1924-standalone rust-analyzer --version: rust-analyzer 1.77.0 (aedd173 2024-03-17)
editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
both VSCodium
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
repository link (if public, optional): (eg. rust-analyzer)
code snippet to reproduce:
#[allow(unused_variables)]#[tokio::main]asyncfnmain(){// indicates impl Future<Output = i32>let a1 = async{8};let a2 = async{return8;// indicates a impl Future<Output = !>};let a3 = async{loop{return8;}// suddenly fine impl Future<Output = i32>};let t1 = tokio::spawn(async{return8;// indicates a JoinHandle<!>});let t2 = tokio::task::spawn_blocking(|| {return8;// this is as expected JoinHandle<i32>});}
Despite hintng Future<Output = !> and JoinHandle<!> the futures actually return correctly the value. Just the hint is incorrect.
Btw I am not a fan of writing explicitly return within async blocks, but if the compiler supports it, the hints should be correct as well.
scrnshot with hints:
The text was updated successfully, but these errors were encountered:
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
VSC: rust-analyzer version: 0.3.1924-standalone
rust-analyzer --version
: rust-analyzer 1.77.0 (aedd173 2024-03-17)rustc version: (eg. output of
rustc -V
)rustc 1.77.0 (aedd173a2 2024-03-17)
editor or extension: (eg. VSCode, Vim, Emacs, etc. For VSCode users, specify your extension version; for users of other editors, provide the distribution if applicable)
both VSCodium
and helix 24.3 (2cadec0b)
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTC
,RUSTUP_HOME
orCARGO_HOME
)repository link (if public, optional): (eg. rust-analyzer)
code snippet to reproduce:
Despite hintng Future<Output = !> and JoinHandle<!> the futures actually return correctly the value. Just the hint is incorrect.
Btw I am not a fan of writing explicitly
return
within async blocks, but if the compiler supports it, the hints should be correct as well.scrnshot with hints:
The text was updated successfully, but these errors were encountered: