We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f61ddd commit 52f98d8Copy full SHA for 52f98d8
clippy_lints/src/use_self.rs
@@ -13,7 +13,7 @@ use rustc_hir::{
13
};
14
use rustc_lint::{LateContext, LateLintPass, LintContext};
15
use rustc_middle::hir::map::Map;
16
-use rustc_middle::ty::{AssocKind, Ty};
+use rustc_middle::ty::{AssocKind, Ty, TyS};
17
use rustc_semver::RustcVersion;
18
use rustc_session::{declare_tool_lint, impl_lint_pass};
19
use rustc_span::{BytePos, Span};
@@ -452,7 +452,7 @@ fn in_impl(cx: &LateContext<'tcx>, hir_ty: &hir::Ty<'_>) -> bool {
452
453
fn should_lint_ty(hir_ty: &hir::Ty<'_>, ty: Ty<'_>, self_ty: Ty<'_>) -> bool {
454
if_chain! {
455
- if ty == self_ty;
+ if TyS::same_type(ty, self_ty);
456
if let TyKind::Path(QPath::Resolved(_, path)) = hir_ty.kind;
457
then {
458
!matches!(path.res, def::Res::SelfTy(..))
0 commit comments