Skip to content

Fix compile errors. #3024

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use rustc::hir::*;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::ty;
use rustc::{declare_lint, lint_array};
use syntax::ast::NodeId;
use syntax_pos::symbol::keywords::SelfType;

/// **What it does:** Checks for unnecessary repetition of structure name when a
Expand Down Expand Up @@ -207,7 +208,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) {
fn visit_path(&mut self, path: &'tcx Path, _id: NodeId) {
if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfType.name() {
span_use_self_lint(self.cx, path);
}
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/utils/internal_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc::hir;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use crate::utils::{match_qpath, paths, span_lint};
use syntax::symbol::LocalInternedString;
use syntax::ast::{Crate as AstCrate, ItemKind, Name};
use syntax::ast::{Crate as AstCrate, ItemKind, Name, NodeId};
use syntax::codemap::Span;
use std::collections::{HashMap, HashSet};

Expand Down Expand Up @@ -198,7 +198,7 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for LintCollector<'a, 'tcx> {
walk_expr(self, expr);
}

fn visit_path(&mut self, path: &'tcx Path, _: HirId) {
fn visit_path(&mut self, path: &'tcx Path, _: NodeId) {
if path.segments.len() == 1 {
self.output.insert(path.segments[0].ident.name);
}
Expand Down
1 change: 1 addition & 0 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {
Def::Const(id) |
Def::AssociatedConst(id) |
Def::Macro(id, ..) |
Def::GlobalAsm(id) |
Def::Existential(id) |
Def::AssociatedExistential(id)
=> Some(id),
Expand Down