Skip to content

Commit 4795c91

Browse files
committed
fix internal lints
1 parent fcb9a38 commit 4795c91

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

clippy_lints/src/derivable_impls.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ use clippy_utils::source::indent_of;
44
use clippy_utils::{is_default_equivalent, peel_blocks};
55
use rustc_errors::Applicability;
66
use rustc_hir::{
7+
self as hir,
78
def::{CtorKind, CtorOf, DefKind, Res},
8-
Body, Expr, ExprKind, GenericArg, Impl, ImplItemKind, Item, ItemKind, Node, PathSegment, QPath, Ty, TyKind,
9+
Body, Expr, ExprKind, GenericArg, Impl, ImplItemKind, Item, ItemKind, Node, PathSegment, QPath, TyKind,
910
};
1011
use rustc_lint::{LateContext, LateLintPass};
1112
use rustc_middle::ty::adjustment::{Adjust, PointerCast};
12-
use rustc_middle::ty::{self, Adt, AdtDef, SubstsRef, TypeckResults};
13+
use rustc_middle::ty::{self, Adt, AdtDef, SubstsRef, Ty, TypeckResults};
1314
use rustc_session::{declare_tool_lint, impl_lint_pass};
1415
use rustc_span::sym;
1516

@@ -76,19 +77,19 @@ fn is_path_self(e: &Expr<'_>) -> bool {
7677
}
7778
}
7879

79-
fn contains_trait_object(ty: ty::Ty<'_>) -> bool {
80+
fn contains_trait_object(ty: Ty<'_>) -> bool {
8081
match ty.kind() {
81-
ty::TyKind::Ref(_, ty, _) => contains_trait_object(*ty),
82-
ty::TyKind::Adt(def, substs) => def.is_box() && substs[0].as_type().map_or(false, contains_trait_object),
83-
ty::TyKind::Dynamic(..) => true,
82+
ty::Ref(_, ty, _) => contains_trait_object(*ty),
83+
ty::Adt(def, substs) => def.is_box() && substs[0].as_type().map_or(false, contains_trait_object),
84+
ty::Dynamic(..) => true,
8485
_ => false,
8586
}
8687
}
8788

8889
fn check_struct<'tcx>(
8990
cx: &LateContext<'tcx>,
9091
item: &'tcx Item<'_>,
91-
self_ty: &Ty<'_>,
92+
self_ty: &hir::Ty<'_>,
9293
func_expr: &Expr<'_>,
9394
adt_def: AdtDef<'_>,
9495
substs: SubstsRef<'_>,

0 commit comments

Comments
 (0)