Clippy lint for avoiding `assert!` in production code?

I've recently implemented

#![warn(clippy::unwrap_used)]
#![cfg_attr(not(test), warn(clippy::panic))]
#![warn(clippy::expect_used)]

in my work code, so that we can avoid panics that prevent us from handling essential data. Unfortunately, I don't see any code that can prevent assert! from being used in production code. Am I missing something? Or is there some other way to prevent this?

(And yes, I'm also thinking about a lint for indexing slices which could also panic.)

disallowed_macros can be configured to deny the use of any macro.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.