Skip to content

panic!("{}") shouldn't compile #22932

Closed
Closed
@tomaka

Description

@tomaka

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.

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)P-mediumMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions