Skip to content

panic lints for debug_assert #7062

Closed
@daxpedda

Description

@daxpedda

Lint name: panic

I tried this code:

debug_assert!(true, "test");

I expected to see this happen: no warning

Instead, this happened: panic should not be present in production code

I am assuming that the error message is correct in saying that this lint is supposed to remove panics from production code, but debug_assert isn't present in debug code. So I consider this a false positive.

EDIT: there might be an issue here, my report might be incorrect, because I can't reproduce this in the Clippy tests, currently researching

This is a false-positive that get's triggered when adding a message to debug_assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions