use rustc_session::{declare_lint_pass, declare_tool_lint};
declare_clippy_lint! {
- /// **What it does:** Checks for `let _ = <expr>`
+ /// ### What it does
+ /// Checks for `let _ = <expr>`
/// where expr is #[must_use]
///
- /// **Why is this bad?** It's better to explicitly
+ /// ### Why is this bad?
+ /// It's better to explicitly
/// handle the value of a #[must_use] expr
///
- /// **Known problems:** None.
- ///
- /// **Example:**
+ /// ### Example
/// ```rust
/// fn f() -> Result<u32, u32> {
/// Ok(0)
}
declare_clippy_lint! {
- /// **What it does:** Checks for `let _ = sync_lock`
+ /// ### What it does
+ /// Checks for `let _ = sync_lock`
///
- /// **Why is this bad?** This statement immediately drops the lock instead of
+ /// ### Why is this bad?
+ /// This statement immediately drops the lock instead of
/// extending its lifetime to the end of the scope, which is often not intended.
/// To extend lock lifetime to the end of the scope, use an underscore-prefixed
/// name instead (i.e. _lock). If you want to explicitly drop the lock,
/// `std::mem::drop` conveys your intention better and is less error-prone.
///
- /// **Known problems:** None.
- ///
- /// **Example:**
+ /// ### Example
///
/// Bad:
/// ```rust,ignore
}
declare_clippy_lint! {
- /// **What it does:** Checks for `let _ = <expr>`
+ /// ### What it does
+ /// Checks for `let _ = <expr>`
/// where expr has a type that implements `Drop`
///
- /// **Why is this bad?** This statement immediately drops the initializer
+ /// ### Why is this bad?
+ /// This statement immediately drops the initializer
/// expression instead of extending its lifetime to the end of the scope, which
/// is often not intended. To extend the expression's lifetime to the end of the
/// scope, use an underscore-prefixed name instead (i.e. _var). If you want to
/// explicitly drop the expression, `std::mem::drop` conveys your intention
/// better and is less error-prone.
///
- /// **Known problems:** None.
- ///
- /// **Example:**
+ /// ### Example
///
/// Bad:
/// ```rust,ignore