We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async_closure
Rust-analyzer shows incorrect type hints for async closures (nightly feature, tracking issue).
#![feature(async_closure)] pub async fn test_async_closure() { let f = async move |num: u8| num + 1; let fut = f(3); let output = fut.await; } pub async fn test_closure_returning_async_block() { let f = |num: u8| async move {num + 1}; let fut = f(3); let output = fut.await; }
RA gives following the inlay hints:
pub async fn test_async_closure() { // Incorrect let f: |u8| -> u8 = async move |num: u8| num + 1; let fut: u8 = f(3); let output: <u8 as Future>::Output = fut.await; } pub async fn test_closure_returning_async_block() { // Correct let f: |u8| -> impl Future<Output = u8> = |num: u8| async move {num + 1}; let fut: impl Future<Output = u8> = f(3); let output: u8 = fut.await; }
(No type errors are given, despite u8: !Future)
u8: !Future
The inlay hints for test_async_closure should be the same as test_closure_returning_async_block.
test_async_closure
test_closure_returning_async_block
rust-analyzer version: rust-analyzer version: 0.4.1159-standalone (3792720 2022-08-05) Also happens on current HEAD
rustc version: rustc 1.64.0-nightly (1b57946a4 2022-08-03)
relevant settings: None that I am aware are relevant.
The text was updated successfully, but these errors were encountered:
8330f8e
Successfully merging a pull request may close this issue.
Rust-analyzer shows incorrect type hints for async closures (nightly feature, tracking issue).
RA gives following the inlay hints:
(No type errors are given, despite
u8: !Future
)The inlay hints for
test_async_closure
should be the same astest_closure_returning_async_block
.rust-analyzer version: rust-analyzer version: 0.4.1159-standalone (3792720 2022-08-05)
Also happens on current HEAD
rustc version: rustc 1.64.0-nightly (1b57946a4 2022-08-03)
relevant settings: None that I am aware are relevant.
The text was updated successfully, but these errors were encountered: