- Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
This lint shows up even when I add as message as a second parameter to the assert! macro.
Lint Name
missing-assert-message
Reproducer
I tried this code:
pub struct Service { ready: bool, } pub fn call(service: Service) { assert!(service.ready, "`service.poll_ready()` must be called first to ensure that service is ready to receive requests"); }I saw this happen:
C:\Users\sandersd\Exercism\rust\poker\src>cargo clippy -- -Dclippy::missing_assert_message Checking poker v1.1.0 (C:\Users\sandersd\Exercism\rust\poker) error: assert without any message --> src\lib.rs:6:5 | 6 | assert!(service.ready, "`service.poll_ready()` must be called first to ensure that service is ready to receive requests... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider describing why the failing assert is problematic = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_assert_message = note: requested on the command line with `-D clippy::missing-assert-message` error: could not compile `poker` (lib) due to 1 previous error``` I expected to see this happen: C:\Users\sandersd\Exercism\rust\poker\src>cargo clippy -- -Dclippy::missing_assert_message Checking poker v1.1.0 (C:\Users\sandersd\Exercism\rust\poker) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.50s ### Version rustc 1.81.0 (eeb90cda1 2024-09-04) binary: rustc commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c commit-date: 2024-09-04 host: x86_64-pc-windows-msvc release: 1.81.0 LLVM version: 18.1.7 ### Additional Labels _No response_ Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Type
Fields
Give feedbackNo fields configured for issues without a type.