move lint documentation into macro invocations
This commit is contained in:
parent
a8f61e70a8
commit
fe96ffeac9
132 changed files with 5405 additions and 5390 deletions
|
@ -6,23 +6,23 @@ use crate::syntax::ast::LitKind;
|
|||
use crate::utils::{in_macro, is_direct_expn_of, span_help_and_lint};
|
||||
use if_chain::if_chain;
|
||||
|
||||
/// **What it does:** Check to call assert!(true/false)
|
||||
///
|
||||
/// **Why is this bad?** Will be optimized out by the compiler or should probably be replaced by a
|
||||
/// panic!() or unreachable!()
|
||||
///
|
||||
/// **Known problems:** None
|
||||
///
|
||||
/// **Example:**
|
||||
/// ```rust
|
||||
/// assert!(false)
|
||||
/// // or
|
||||
/// assert!(true)
|
||||
/// // or
|
||||
/// const B: bool = false;
|
||||
/// assert!(B)
|
||||
/// ```
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Check to call assert!(true/false)
|
||||
///
|
||||
/// **Why is this bad?** Will be optimized out by the compiler or should probably be replaced by a
|
||||
/// panic!() or unreachable!()
|
||||
///
|
||||
/// **Known problems:** None
|
||||
///
|
||||
/// **Example:**
|
||||
/// ```rust
|
||||
/// assert!(false)
|
||||
/// // or
|
||||
/// assert!(true)
|
||||
/// // or
|
||||
/// const B: bool = false;
|
||||
/// assert!(B)
|
||||
/// ```
|
||||
pub ASSERTIONS_ON_CONSTANTS,
|
||||
style,
|
||||
"assert!(true/false) will be optimized out by the compiler/should probably be replaced by a panic!() or unreachable!()"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue