diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-02-09 19:42:32 -0600 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-02-10 11:58:21 +0100 |
| commit | 52f98d832dc5ca982b9edad7807b2a9a9ddd13e0 (patch) | |
| tree | 167d96f925f872bc06f42030412db225e3f6aa5d | |
| parent | 7f61ddd5b85f5e2340ef238476139df8a837afb1 (diff) | |
Use TyS::same_type
| -rw-r--r-- | clippy_lints/src/use_self.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 8c83ad5650d..a0dd53af661 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -13,7 +13,7 @@ use rustc_hir::{ }; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_middle::hir::map::Map; -use rustc_middle::ty::{AssocKind, Ty}; +use rustc_middle::ty::{AssocKind, Ty, TyS}; use rustc_semver::RustcVersion; use rustc_session::{declare_tool_lint, impl_lint_pass}; use rustc_span::{BytePos, Span}; @@ -452,7 +452,7 @@ fn in_impl(cx: &LateContext<'tcx>, hir_ty: &hir::Ty<'_>) -> bool { fn should_lint_ty(hir_ty: &hir::Ty<'_>, ty: Ty<'_>, self_ty: Ty<'_>) -> bool { if_chain! { - if ty == self_ty; + if TyS::same_type(ty, self_ty); if let TyKind::Path(QPath::Resolved(_, path)) = hir_ty.kind; then { !matches!(path.res, def::Res::SelfTy(..)) |
