Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic lints for assert with formatting #7433

Closed
iliakonnov opened this issue Jul 4, 2021 · 0 comments · Fixed by #7439
Closed

panic lints for assert with formatting #7433

iliakonnov opened this issue Jul 4, 2021 · 0 comments · Fixed by #7439
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@iliakonnov
Copy link

Lint name: panic

I tried this code:

#![warn(clippy::panic)]
fn main() {
    assert!(true, "True is not true!");
}

I expected to see this happen: No warning

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

For example, following code does not produce this warning:

#![warn(clippy::panic)]
fn main() {
    assert!(true);
}

I believe that behaviour should be the same, regardless of optional message existence. Both the warn on assert! and no warning will be reasonable, but the latter looks better for me.

This issue looks very similar to #7062.

Meta

  • cargo clippy -V: clippy 0.1.55 (71b8742 2021-07-03)
  • rustc -Vv:
    rustc 1.55.0-nightly (71b8742bb 2021-07-03)
    binary: rustc
    commit-hash: 71b8742bbcbed2cd908dbc031d6552d8b528c037
    commit-date: 2021-07-03
    host: x86_64-unknown-linux-gnu
    release: 1.55.0-nightly
    LLVM version: 12.0.1
    
@iliakonnov iliakonnov added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Jul 4, 2021
@giraffate giraffate added the good-first-issue These issues are a good way to get started with Clippy label Jul 5, 2021
@bors bors closed this as completed in 28e7699 Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing good-first-issue These issues are a good way to get started with Clippy I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants