assertions_on_constants should not trigger inside const
blocks
#12847
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
As of #11966,
assertions_on_constants
does not trigger forconst _: () = assert!(expr)
.In recent Rust versions, this can be more nicely written as
const { assert!(expr) }
.IMO assertions in
const
blocks should be exempted fromassertions_on_constants
, because generally their entire purpose is to be evaluated at compile time.Lint Name
assertions_on_constants
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No warnings.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: