Skip to content

rustup clippy build with latest rustc #3501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
@@ -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);
}

2 changes: 1 addition & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -970,7 +970,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {

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
}