1
Fork 0

move lint documentation into macro invocations

This commit is contained in:
Andy Russell 2019-03-05 11:50:33 -05:00
parent a8f61e70a8
commit fe96ffeac9
No known key found for this signature in database
GPG key ID: BE2221033EDBC374
132 changed files with 5405 additions and 5390 deletions

View file

@ -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!()"