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

Most upvoted comments

The diagnostic is now called unresolved-macro-call

I’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.json at the root of your project folder containing:

{
    "rust-analyzer.diagnostics.disabled": [
        "macro-error"
    ]
}

Any error that rust-analyzer produces in code that compiles is a problem in rust-analyzer.

You can disable the diagnostic by adding macro-error to the rust-analyzer.diagnostics.disabled setting.

join_internal seems to be a proc_macro_hack macro; 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:

{
    "rust-analyzer.diagnostics.disabled": [
        "unresolved-proc-macro"
    ]
}

Ah, it’s a proc_macro_hack thing.

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.