Detect Python-style f-string debug syntax in format strings and emit a
clear diagnostic explaining that it is not supported in Rust. When the
intended operation can be inferred, suggest the corresponding Rust
alternative e.g from `println!("{=}", x)` to `dbg!({x})`.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
5 lines
127 B
Rust
5 lines
127 B
Rust
//@ run-rustfix
|
|
fn main() {
|
|
let x = 32;
|
|
println!("{=}", x); //~ ERROR invalid format string: python's f-string debug
|
|
}
|