From b3f755a598420c90bb4c696f3bff761799cdf978 Mon Sep 17 00:00:00 2001 From: Pieter Penninckx Date: Fri, 10 Aug 2018 10:00:07 +0200 Subject: [PATCH] Fix compile errors. --- clippy_lints/src/use_self.rs | 3 ++- clippy_lints/src/utils/internal_lints.rs | 4 ++-- clippy_lints/src/utils/mod.rs | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index eb2b4e801ebf..79da4c7d288d 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -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 @@ -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); } diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index 226817c8e51f..32aee0991771 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -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}; @@ -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); } diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 32a891c8cbbf..6941c5ab19ee 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -937,6 +937,7 @@ pub fn opt_def_id(def: Def) -> Option { Def::Const(id) | Def::AssociatedConst(id) | Def::Macro(id, ..) | + Def::GlobalAsm(id) | Def::Existential(id) | Def::AssociatedExistential(id) => Some(id),