Paths printed with {:?} instead of .display()
What it does
Warn when a Debug representation of Path is used in format! or println!, instead of path.display().
Advantage
Rust doesn't guarantee how Debug formatting looks like, and it could change in the future. For printing paths there's the dedicated .display() method.
Drawbacks
Not every Debug print of a Path is incorrect: it may be used in dbg!(), or when a PathBuf is a field in a struct that is Debug-printed as a whole.
Example
let path = Path::new("…");
println!("The path is {:?}", path);
Could be written as:
let path = Path::new("…");
println!("The path is {}", path.display());
At the risk of feature creep, it might be good to warn about println!("... {} ...", path.to_string_lossy()) also.
Another reason is that I'm removing support for Debug from the executables I build:
https://github.com/rust-lang/rust/pull/123940