Skip to content

Commit 52f98d8

Browse files
camsteffenflip1995
authored andcommitted
Use TyS::same_type
1 parent 7f61ddd commit 52f98d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/use_self.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_hir::{
1313
};
1414
use rustc_lint::{LateContext, LateLintPass, LintContext};
1515
use rustc_middle::hir::map::Map;
16-
use rustc_middle::ty::{AssocKind, Ty};
16+
use rustc_middle::ty::{AssocKind, Ty, TyS};
1717
use rustc_semver::RustcVersion;
1818
use rustc_session::{declare_tool_lint, impl_lint_pass};
1919
use rustc_span::{BytePos, Span};
@@ -452,7 +452,7 @@ fn in_impl(cx: &LateContext<'tcx>, hir_ty: &hir::Ty<'_>) -> bool {
452452

453453
fn should_lint_ty(hir_ty: &hir::Ty<'_>, ty: Ty<'_>, self_ty: Ty<'_>) -> bool {
454454
if_chain! {
455-
if ty == self_ty;
455+
if TyS::same_type(ty, self_ty);
456456
if let TyKind::Path(QPath::Resolved(_, path)) = hir_ty.kind;
457457
then {
458458
!matches!(path.res, def::Res::SelfTy(..))

0 commit comments

Comments
 (0)