rust-analyzer
rust-analyzer copied to clipboard
completion failed inside macro call
RA version: 2021-01-11 (0976a1e)
Dependencies: crossbeam = "0.8.0"
fn main() {
let (_, r1) = crossbeam::channel::bounded::<()>(1);
let (_, r2) = crossbeam::channel::bounded::<()>(1);
crossbeam::select! {
recv(r1) -> _ => {
// completion failed here
},
recv(r2) -> _ => {
}
}
}

Besides, it works fine with only one select arm:
fn main() {
let (_, r1) = crossbeam::channel::bounded::<()>(1);
let (_, r2) = crossbeam::channel::bounded::<()>(1);
crossbeam::select! {
recv(r1) -> _ => {
// completion works fine
},
// recv(r2) -> _ => ()
}
}

I'm new to the macro system, so I didn't find a smaller reproducible example.
Turns out pretty much nothing works inside that macro, not even hover. The macro does get expanded though...
I'm hitting a very similar issue with tokio::select! in the latest nightly as of this writing, completion works for a little while then grinds to a half, then it refuses to update all diagnostics after some point, and I see a lot of
"diagnostics": [
{
"range": {
"start": {
"line": 57,
"character": 30
},
"end": {
"line": 57,
"character": 32
}
},
"severity": 1,
"code": "macro-error",
"codeDescription": {
"href": "https://rust-analyzer.github.io/manual.html#macro-error"
},
"source": "rust-analyzer",
"message": ""
},
{
"range": {
"start": {
"line": 57,
"character": 30
},
"end": {
"line": 57,
"character": 32
}
},
"severity": 1,
"code": "macro-error",
"codeDescription": {
"href": "https://rust-analyzer.github.io/manual.html#macro-error"
},
"source": "rust-analyzer",
"message": "reached recursion limit during macro expansion"
},
in the trace logs