Code
#[derive(Debug)]
enum UwU {
QwQ, AwA, QAQ,
}
fn main() {
println!({:?}, UwU::QwQ)
}
Current output
error: expected expression, found `:`
--> src/main.rs:7:15
|
7 | println!({:?}, UwU::QwQ)
| ^ expected expression
|
help: maybe write a path separator here
|
7 | println!({::?}, UwU::QwQ)
| +
error: format argument must be a string literal
--> src/main.rs:7:14
|
7 | println!({:?}, UwU::QwQ)
| ^^^^
|
help: you might be missing a string literal to format with
|
7 | println!("{} {}", {:?}, UwU::QwQ)
| ++++++++
error: could not compile `playground` (bin "playground") due to 2 previous errors
Desired output
error: expected expression, found `:`
--> src/main.rs:7:15
|
7 | println!({:?}, UwU::QwQ)
| ^ expected expression
|
help: maybe write a path separator here
|
7 | println!({::?}, UwU::QwQ)
| +
error: format argument must be a string literal
--> src/main.rs:7:14
|
7 | println!({:?}, UwU::QwQ)
| ^^^^
|
help: you might be missing a string literal to format with
|
7 | println!("{} {}", {:?}, UwU::QwQ)
| ++++++++
help: you might want to enclose `{:?}` in `""`
|
7 | println!("{:?}", UwU::QwQ)
| ++++++
error: could not compile `playground` (bin "playground") due to 2 previous errors
Rationale and extra context
I think this is most likely what users intended when writing something like {}, {:?} or {:#?} in this context, and usually the slight difference between "{:?}" and {:?} is easy to miss at a glance, so I think this suggestion could be helpful.
Other cases
Rust Version
playground 1.97.0-nightly
(2026-04-18 0febdbab2720dc0360cd)
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
I think this is most likely what users intended when writing something like
{},{:?}or{:#?}in this context, and usually the slight difference between"{:?}"and{:?}is easy to miss at a glance, so I think this suggestion could be helpful.Other cases
Rust Version
Anything else?
No response