-use crate::consts::{constant, Constant};
+use clippy_utils::consts::{constant, Constant};
use clippy_utils::diagnostics::span_lint_and_help;
use clippy_utils::source::snippet_opt;
use clippy_utils::{is_direct_expn_of, is_expn_of, match_panic_call};
use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
- /// **What it does:** Checks for `assert!(true)` and `assert!(false)` calls.
+ /// ### What it does
+ /// Checks for `assert!(true)` and `assert!(false)` calls.
///
- /// **Why is this bad?** Will be optimized out by the compiler or should probably be replaced by a
+ /// ### Why is this bad?
+ /// Will be optimized out by the compiler or should probably be replaced by a
/// `panic!()` or `unreachable!()`
///
- /// **Known problems:** None
+ /// ### Known problems
+ /// None
///
- /// **Example:**
+ /// ### Example
/// ```rust,ignore
/// assert!(false)
/// assert!(true)
&format!("`assert!(false, {})` should probably be replaced", panic_message),
None,
&format!("use `panic!({})` or `unreachable!({})`", panic_message, panic_message),
- )
+ );
};
if let Some(debug_assert_span) = is_expn_of(e.span, "debug_assert") {