diff options
| author | ljedrz <ljedrz@gmail.com> | 2019-02-27 17:35:24 +0100 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2019-03-02 07:48:52 +0100 |
| commit | 77fa041fc1ca58b2ccbdb600f39aa92da1276970 (patch) | |
| tree | 8f691623d821f4ab7ab2a0b6674dfbf7a09a09cd /src/librustc_plugin/build.rs | |
| parent | 3c25193f3ff60faff504a24749761970a72ccdc6 (diff) | |
| download | rust-77fa041fc1ca58b2ccbdb600f39aa92da1276970.tar.gz rust-77fa041fc1ca58b2ccbdb600f39aa92da1276970.zip | |
hir: remove NodeId from Item
Diffstat (limited to 'src/librustc_plugin/build.rs')
| -rw-r--r-- | src/librustc_plugin/build.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/librustc_plugin/build.rs b/src/librustc_plugin/build.rs index c1ba4d7b3d8..31018a7cd7a 100644 --- a/src/librustc_plugin/build.rs +++ b/src/librustc_plugin/build.rs @@ -1,6 +1,5 @@ //! Used by `rustc` when compiling a plugin crate. -use syntax::ast; use syntax::attr; use syntax_pos::Span; use rustc::hir::itemlikevisit::ItemLikeVisitor; @@ -10,7 +9,7 @@ use rustc::ty::TyCtxt; use rustc::ty::query::Providers; struct RegistrarFinder { - registrars: Vec<(ast::NodeId, Span)> , + registrars: Vec<(hir::HirId, Span)> , } impl<'v> ItemLikeVisitor<'v> for RegistrarFinder { @@ -18,7 +17,7 @@ impl<'v> ItemLikeVisitor<'v> for RegistrarFinder { if let hir::ItemKind::Fn(..) = item.node { if attr::contains_name(&item.attrs, "plugin_registrar") { - self.registrars.push((item.id, item.span)); + self.registrars.push((item.hir_id, item.span)); } } } @@ -47,8 +46,8 @@ fn plugin_registrar_fn<'tcx>( match finder.registrars.len() { 0 => None, 1 => { - let (node_id, _) = finder.registrars.pop().unwrap(); - Some(tcx.hir().local_def_id(node_id)) + let (hir_id, _) = finder.registrars.pop().unwrap(); + Some(tcx.hir().local_def_id_from_hir_id(hir_id)) }, _ => { let diagnostic = tcx.sess.diagnostic(); |
