You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code (when placed at the root of a crate) causes rust analyzer to fully crash. All functionally of rust analyzer is lost until the macro call is fixed or removed. In which case rust analyzer immediately begins functioning again (most of the time).
I have no idea why this particular setup is what causes the crash. I found this while developing a macro in the wild and scaled it down to this. I have also had multiple people confirm this happens on other instances of rust analyzer and not just my machine.
mod any {#[macro_export]macro_rules! nameable {{struct $name:ident[$a:lifetime]} => {
$crate::any::nameable! {struct $name[$a]
a
}};{struct $name:ident[$a:lifetime]
a
} => {};}pubuse nameable;nameable!{Name['a]}}
The following code (when placed at the root of a crate) causes rust analyzer to fully crash. All functionally of rust analyzer is lost until the macro call is fixed or removed. In which case rust analyzer immediately begins functioning again (most of the time).
I have no idea why this particular setup is what causes the crash. I found this while developing a macro in the wild and scaled it down to this. I have also had multiple people confirm this happens on other instances of rust analyzer and not just my machine.
The above code does not compile, but rust analyzer should be reporting that the macro failed to be called like rustc does when run separately.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ed43d742a8607e61aa113fe6491a6fc6
The panic is (The top part is the context reported by neovim):
rust-analyzer version: 1.76.0 (07dca48 2024-02-04)
rustc version: rustc 1.76.0 (07dca489a 2024-02-04)
The text was updated successfully, but these errors were encountered: