|
23 | 23 | extern crate matches; |
24 | 24 | extern crate rustc; |
25 | 25 | extern crate rustc_driver; |
| 26 | +extern crate rustc_hir; |
| 27 | +extern crate rustc_lint; |
26 | 28 | extern crate rustc_session; |
| 29 | +extern crate rustc_span; |
27 | 30 | extern crate syntax; |
28 | 31 |
|
29 | | -use rustc::hir::def_id::DefId; |
30 | | -use rustc::hir::intravisit as visit; |
31 | | -use rustc::hir::{self, ExprKind, HirId}; |
32 | | -use rustc::lint::{LateContext, LateLintPass, LintContext, LintPass}; |
33 | 32 | use rustc::ty; |
34 | 33 | use rustc_driver::plugin::Registry; |
| 34 | +use rustc_hir::def_id::DefId; |
| 35 | +use rustc_hir::intravisit as visit; |
| 36 | +use rustc_hir::{self as hir, ExprKind, HirId}; |
| 37 | +use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass}; |
35 | 38 | use rustc_session::declare_lint; |
| 39 | +use rustc_span::source_map; |
| 40 | +use rustc_span::source_map::{ExpnKind, MacroKind, Span}; |
| 41 | +use rustc_span::symbol::sym; |
| 42 | +use rustc_span::symbol::Symbol; |
36 | 43 | use syntax::ast::{AttrKind, Attribute}; |
37 | | -use syntax::source_map; |
38 | | -use syntax::source_map::{ExpnKind, MacroKind, Span}; |
39 | | -use syntax::symbol::sym; |
40 | | -use syntax::symbol::Symbol; |
41 | 44 |
|
42 | 45 | #[allow(deprecated)] |
43 | 46 | #[plugin_registrar] |
@@ -290,6 +293,8 @@ struct FnDefVisitor<'a, 'b: 'a, 'tcx: 'a + 'b> { |
290 | 293 | } |
291 | 294 |
|
292 | 295 | impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { |
| 296 | + type Map = rustc::hir::map::Map<'tcx>; |
| 297 | + |
293 | 298 | fn visit_expr(&mut self, expr: &'tcx hir::Expr) { |
294 | 299 | let cx = self.cx; |
295 | 300 |
|
@@ -353,7 +358,9 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { |
353 | 358 |
|
354 | 359 | fn visit_ty(&mut self, _: &'tcx hir::Ty) {} |
355 | 360 |
|
356 | | - fn nested_visit_map<'this>(&'this mut self) -> hir::intravisit::NestedVisitorMap<'this, 'tcx> { |
| 361 | + fn nested_visit_map<'this>( |
| 362 | + &'this mut self, |
| 363 | + ) -> hir::intravisit::NestedVisitorMap<'this, Self::Map> { |
357 | 364 | hir::intravisit::NestedVisitorMap::OnlyBodies(&self.cx.tcx.hir()) |
358 | 365 | } |
359 | 366 | } |
|
0 commit comments