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.