Description
rust-analyzer version: rust-analyzer version: 0.3.2353-standalone (37acea8 2025-03-23)
rustc version: rustc 1.87.0-nightly (f8c27dfe1 2025-03-24)
editor or extension: VSCode
relevant settings: i dont know
code snippet to reproduce:
minimal:
fn minimal_case() {
let anything_display = 1;
format_args!("{}", anything_display);
}
other examples:
fn higher_macros() {
panic!("panic uses format args{}", "");
}
fn real_code() {
let vec: Vec<u8> = vec![];
let formatted = format!("real {} code that can happen", vec.len());
println!("very {} in real life ", formatted);
}
fn main() {
minimal_case();
higher_macros();
real_code();
}
any macro that calls format_args with an argument that can be formatted, will cause this "warning". the warning is in the OUTPUT section of the editor, under Rust Analyzer Language Server from the dropdown:
...
2025-03-26T18:36:02.853090122+03:00 ERROR synthetic syntax
2025-03-26T18:36:02.853171069+03:00 ERROR synthetic syntax
2025-03-26T18:36:02.853212834+03:00 ERROR synthetic syntax
2025-03-26T18:36:02.853218002+03:00 ERROR synthetic syntax
2025-03-26T18:36:16.090820077+03:00 ERROR synthetic syntax
2025-03-26T18:36:16.09091122+03:00 ERROR synthetic syntax
2025-03-26T18:36:16.090965557+03:00 ERROR synthetic syntax
2025-03-26T18:36:16.090972821+03:00 ERROR synthetic syntax
2025-03-26T18:38:08.535456768+03:00 ERROR synthetic syntax
2025-03-26T18:38:08.535573823+03:00 ERROR synthetic syntax
2025-03-26T18:38:08.53561922+03:00 ERROR synthetic syntax
2025-03-26T18:38:08.535625855+03:00 ERROR synthetic syntax
...
It will produce as many ERROR synthetic syntax
messages as there are calls to format_args!
in the source code (whether direct, or indirect, as shown above).
I am pretty much sure this can't be reproduced, otherwise it would be recognized immediately. This doesn't cause any issue per se, but it is still annoying to not be able to see Rust Analyzer Language Server output because of this error.
It is also a very cryptic error message with no payload attached. Why is it like this?