rust-analyzer: Macro error with futures::try_join!
Same as @jeromegn , I am still getting the error on the nightly version of rust-analyzer, in my case in a call to futures::try_join!.
_Originally posted by @Victor-Savu in https://github.com/rust-analyzer/rust-analyzer/issues/6716#issuecomment-743399274_
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 36
- Comments: 34 (15 by maintainers)
Commits related to this issue
- Disable macro-error in rust diagnostics https://github.com/rust-analyzer/rust-analyzer/issues/6835 — committed to lambdalisue/dotfiles by lambdalisue 3 years ago
- fix(rust_analyzer): Disable diagnostics on unresolved proc-macros due to bug https://github.com/rust-lang/rust-analyzer/issues/6835 — committed to PopBogdan97/nvim-ide by PopBogdan97 a year ago
The diagnostic is now called
unresolved-macro-callI’ve just ran into this issue recently with pyo3. you can try it yourself with pyo3 numpy example project: https://github.com/PyO3/rust-numpy/tree/main/examples/simple-extension.
I’d rather keep it open. It will probably take years until the ecosystem uses futures 0.4
I will backport that patch to 0.3, so no need to wait for futures 0.4. (See the label of the PR that fixed the issue)
Released futures 0.3.15 which includes the fix for this issue.
This also occurs with Yew’s
html!macro.@bionicles if you are using VSCode, create a file
.vscode/settings.jsonat the root of your project folder containing:Any error that rust-analyzer produces in code that compiles is a problem in rust-analyzer.
You can disable the diagnostic by adding
macro-errorto therust-analyzer.diagnostics.disabledsetting.join_internalseems to be aproc_macro_hackmacro; that’s probably the problem.Same here. This affect all futures macros, like select, join etc.
In my particular case, I was getting the problem with Yew’s macros. Other macros from other libraries like Embassy seemed to work.
To work-around my issue, my settings.json looks like:
Ah, it’s a
proc_macro_hackthing.I’ll close this issue, a lot of comments in here are about very different issues making it difficult to figure out what the problem even is at this point. So we gain more from people opening new specific issues instead.