Skip to content

panic lints for debug_assert #7062

@daxpedda

Description

@daxpedda
Contributor

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.

Activity

added
C-bugCategory: Clippy is not doing the correct thing
I-false-positiveIssue: The lint was triggered on code it shouldn't have
on Apr 10, 2021
added a commit that references this issue on Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @daxpedda

      Issue actions

        `panic` lints for `debug_assert` · Issue #7062 · rust-lang/rust-clippy