rust-analyzer version: 0add6e9 2021-12-20 stable
rustc version: rustc 1.58.0 (02072b482 2022-01-11)
Formatting files that have @generated instead empties the whole file.
This issue will hit more users as we had to use rustfmt +nightly before to encounter it, while with the 1.58 release all users will be affected.
This only happens if format_generated_files is false in rustfmt.toml (newly released in 1.58).