use if_chain::if_chain;
-use rustc::declare_lint_pass;
-use rustc::hir::*;
-use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
-use rustc_session::declare_tool_lint;
+use rustc::lint::{LateContext, LateLintPass};
+use rustc_hir::*;
+use rustc_session::{declare_lint_pass, declare_tool_lint};
use crate::utils::{is_must_use_func_call, is_must_use_ty, span_help_and_lint};
/// ```
pub LET_UNDERSCORE_MUST_USE,
restriction,
- "non-binding let on a #[must_use] expression"
+ "non-binding let on a `#[must_use]` expression"
}
declare_lint_pass!(LetUnderscore => [LET_UNDERSCORE_MUST_USE]);
cx,
LET_UNDERSCORE_MUST_USE,
stmt.span,
- "non-binding let on an expression with #[must_use] type",
+ "non-binding let on an expression with `#[must_use]` type",
"consider explicitly using expression value"
)
} else if is_must_use_func_call(cx, init) {
cx,
LET_UNDERSCORE_MUST_USE,
stmt.span,
- "non-binding let on a result of a #[must_use] function",
+ "non-binding let on a result of a `#[must_use]` function",
"consider explicitly using function result"
)
}