-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust-analyzer dies when there's an error in a tokio::select macro #10051
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
Somewhat relevant, recently cargo check seems to misbehave in multi project workspaces (it only shows errors from one project). |
I finally figured out when this is happening: it's when there's an error in a |
@FredrikNoren can you make a test project which reproduces the issue? If not, I'll try to do it when I have some time. |
@lnicola This stops producing "problems" in vscode for me: use std::time::Duration;
#[tokio::main]
async fn main() {
tokio::select! {
x = tokio::time::sleep(Duration::from_secs_f32(1.)) => {
let x = ;
}
}
println!("";
} |
Confirmed, thanks for the lovely repro. |
Just fn main() {
tokio::select! {
x
}
} is enough to get diagnostics stuck. |
minimal macro that causes this macro_rules! select {
(@ { $($t:tt)* } ) => {
// No `else` branch
select!(@{ $($t)*; unreachable!() })
};
( $p:pat = $($t:tt)* ) => {
select!(@{ () } $p = $($t)*)
};
() => {};
}
fn main() {
select! {
x
}
} checking the server trace we do publish diagnostics though, so this is rather odd that they aren't being updated?. |
Huh so this might be a code bug macro_rules! f {
() => {
compile_error!("");
};
}
f!(); breaks the diagnostics of the file, which I assume is because we post an empty diagnostics message(which also happens in the select macro, though I am not sure why that happens there) |
Hi,
First of all; thanks for an amazing tool!
However, I'm having an issue that several times per day rust-analyzer just seems to die and stops showing the cargo check messages (only showing a few seemingly random warning messages but no errors). I usually try to restart rust-analyzer, restart VS Code, and re-save random files at this point, and sometimes that helps but sometimes that doesn't even seem to help (I have no idea what makes it come back to life after that, perhaps a rebuild).
This is on OSX, rust-analyzer version 0.2.718, VSCode version 1.59.1, but the problem has been around since I started using rust-analyzer about a year ago.
Edit: I've realized that this only happens when there's an error in a
tokio::select!
macro.The text was updated successfully, but these errors were encountered: