Is intelliJ type inference broken for blocks inside futures::select!?

futures::select! {
  x = ... => { BLOCKI }

It appears that inside BLOCK, the type of x is unknown and there is no type inference. Am I doing something wrong, or is this just the way things are with IntelliJ's dealing with the futures::select! macro ?

What's inside proc macros doesn't need to be "valid Rust", so source code tools don't assume they can operate on what's inside of them.

If you use rustfmt you'll also notice it won't reformat the code inside the macro.

(Though I believe some tools will process certain specific "known good" macros).

Actually, since this is due to the use of proc macros, I wonder if Tokio's select! works better here, as that macro uses a declarative macro rather than a proc macro. I don't have IntelliJ myself, so I can't really test it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.