Skip to content

Panic lint doesn't catch panics with formatting #5767

Closed
@paulkernfeld

Description

@paulkernfeld

It looks to me like the panic lint doesn't catch panics with formatting. Although maybe this is intentional, I would expect it to treat panics with and without formatting the same way.

I tried this code:

#[deny(clippy::panic)]
pub fn main() {
    panic!("{}", "This is a panic");
}

I expected to cargo clippy to fail on this code, but it passes.

Meta

  • cargo clippy -V: clippy 0.0.212 (bb37a0f 2020-06-16)
  • rustc -Vv:
rustc 1.44.1 (c7087fe00 2020-06-17)
binary: rustc
commit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7
commit-date: 2020-06-17
host: x86_64-apple-darwin
release: 1.44.1
LLVM version: 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingC-enhancementCategory: Enhancement of lints, like adding more cases or adding help messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions