I didn't find any duplicate issue, but this problem has probably been there for a long time.
- The code
panic!("{}", 7) compiles and prints thread <main> panicked at "7", ...
- The code
panic!("{} {}", 7) doesn't compile as an argument is missing
- The code
panic!("{}") does compile and prints thread <main> panicked at "{}", ...
The last one doesn't detect potential mistakes, and is inconsistent with println!("{}") which doesn't compile.
I didn't find any duplicate issue, but this problem has probably been there for a long time.
panic!("{}", 7)compiles and printsthread <main> panicked at "7", ...panic!("{} {}", 7)doesn't compile as an argument is missingpanic!("{}")does compile and printsthread <main> panicked at "{}", ...The last one doesn't detect potential mistakes, and is inconsistent with
println!("{}")which doesn't compile.