-
Notifications
You must be signed in to change notification settings - Fork 1.7k
procedural macro + anyhow macro causes type-mismatch: expected Result<{unknown}, Error>, found () #12184
New issue
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
Comments
I have found this workaround from #11815 useful: "rust-analyzer.diagnostics.disabled": [
"type-mismatch"
], update: now "rust-analyzer.diagnostics.disabled": [
"E0308"
], |
The attr proc-macro doesn't get expanded at all, that's what's causing the type mismatch. |
Ye, we only support attributes on items currently |
Right, I don't think we expand attribute macros on expressions. |
Rather than globally disabling the |
No, there isn't. |
Is there any plan (i.e. a GitHub issue I could follow) for expanding attribute macros on expressions? Or any other suggestions that wouldn't require globally disabling the often-useful diagnostic? |
Closing as duplicate of the above issue |
Rust nightly accepts this code, but rust-analyzer is confused by the combination of a procedural macro (futures_async_stream::try_stream) and an anyhow macro:
(
if true
does the same.)(also available at https://github.com/ludios/ra-proc-macro-type-issue)
rust-analyzer version: 1f709d5 2022-05-05 nightly
rustc version: rustc 1.62.0-nightly (30f386087 2022-05-05)
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTUP_HOME
orCARGO_HOME
)The text was updated successfully, but these errors were encountered: