I use neovim (kickstart) and have the rust-analyzer Lsp activated, for rust files. Whenever I write static or const in my code, the Lsp adds "rewriting static" at the top of the file. When I say LspStop it does (obviously) not happen anymore.
However, this happens only in one project, where I am currently following this tutorial: Writing an OS in Rust
I have also setup a completely new project and it does not add "rewriting static" when I include static or const in my code.
You're probably just running a faulty version of rustfmt. Running rustup update
fixed it for me.
Issue: https://github.com/rust-lang/rustfmt/issues/6210
Fix: https://github.com/rust-lang/rust/pull/126888
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With