From 45cbdf471d896abd3f2c11cbdffbaf8379951917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Thu, 6 Dec 2018 16:38:32 +0100 Subject: [PATCH] rustup clippy build with latest rustc (breakage due to https://github.com/rust-lang/rust/commit/08f8faedd0e30f45762afbb8d4873f7041e7462c ) Fixes #3500 --- clippy_lints/src/use_self.rs | 4 ++-- clippy_lints/src/utils/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 3a71a6d04afd..27ca01b8141e 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -14,7 +14,7 @@ use crate::rustc::ty; use crate::rustc::{declare_tool_lint, lint_array}; use crate::rustc_errors::Applicability; use crate::syntax::ast::NodeId; -use crate::syntax_pos::symbol::keywords::SelfType; +use crate::syntax_pos::symbol::keywords::SelfUpper; use crate::utils::{in_macro, span_lint_and_sugg}; use if_chain::if_chain; @@ -226,7 +226,7 @@ struct UseSelfVisitor<'a, 'tcx: 'a> { impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> { fn visit_path(&mut self, path: &'tcx Path, _id: HirId) { - if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfType.name() { + if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfUpper.name() { span_use_self_lint(self.cx, path); } diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 0c6935d867da..316fee6b0e18 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -970,7 +970,7 @@ pub fn opt_def_id(def: Def) -> Option { pub fn is_self(slf: &Arg) -> bool { if let PatKind::Binding(_, _, name, _) = slf.pat.node { - name.name == keywords::SelfValue.name() + name.name == keywords::SelfLower.name() } else { false }