Skip to content

Commit bb8208d

Browse files
committed
Import declared lints at the top of the file
1 parent 2afa7df commit bb8208d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

clippy_lints/src/types/borrowed_box.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use if_chain::if_chain;
99

1010
use crate::utils::{match_path, paths, snippet, span_lint_and_sugg};
1111

12+
use super::BORROWED_BOX;
13+
1214
pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, mut_ty: &MutTy<'_>) -> bool {
1315
match mut_ty.ty.kind {
1416
TyKind::Path(ref qpath) => {
@@ -61,7 +63,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
6163
};
6264
span_lint_and_sugg(
6365
cx,
64-
super::BORROWED_BOX,
66+
BORROWED_BOX,
6567
hir_ty.span,
6668
"you seem to be trying to use `&Box<T>`. Consider using just `&T`",
6769
"try",

clippy_lints/src/types/linked_list.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use rustc_lint::LateContext;
33

44
use crate::utils::{match_def_path, paths, span_lint_and_help};
55

6+
use super::LINKEDLIST;
7+
68
pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, def_id: DefId) -> bool {
79
if match_def_path(cx, def_id, &paths::LINKED_LIST) {
810
span_lint_and_help(
911
cx,
10-
super::LINKEDLIST,
12+
LINKEDLIST,
1113
hir_ty.span,
1214
"you seem to be using a `LinkedList`! Perhaps you meant some other data structure?",
1315
None,

clippy_lints/src/types/option_option.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ use rustc_span::symbol::sym;
44

55
use crate::utils::{is_ty_param_diagnostic_item, span_lint};
66

7+
use super::OPTION_OPTION;
8+
79
pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool {
810
if cx.tcx.is_diagnostic_item(sym::option_type, def_id) {
911
if is_ty_param_diagnostic_item(cx, qpath, sym::option_type).is_some() {
1012
span_lint(
1113
cx,
12-
super::OPTION_OPTION,
14+
OPTION_OPTION,
1315
hir_ty.span,
1416
"consider using `Option<T>` instead of `Option<Option<T>>` or a custom \
1517
enum if you need to distinguish all 3 cases",

0 commit comments

Comments
 (0)