Closed
Description
Code
struct X;
impl std::fmt::Display for X {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "x")
}
}
fn main() {
let x = X;
println!("test: {x} {x:?}");
}
Current output
error[E0277]: `X` doesn't implement `Debug`
--> src/main.rs:11:22
|
11 | println!("test: {x} {x:?}");
| ^ `X` cannot be formatted using `{:?}`
Desired output
error[E0277]: `X` doesn't implement `Debug`
--> src/main.rs:11:22
|
11 | println!("test: {x} {x:?}");
| ^ `X` cannot be formatted using `{:?}`
Rationale and extra context
No response
Other cases
No response