about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2019-06-24 10:03:37 +0200
committerljedrz <ljedrz@gmail.com>2019-06-24 10:03:37 +0200
commitd82a12f64f05d33f10f0e345e14175c4256703f8 (patch)
tree974bd455bbb01de05d2a52b36dc278923eae2e6f /src
parentf05cbc98f8402f3146f96ebde63148427b3322f1 (diff)
downloadrust-d82a12f64f05d33f10f0e345e14175c4256703f8.tar.gz
rust-d82a12f64f05d33f10f0e345e14175c4256703f8.zip
HirIdify driver::pretty::HirPrinterSupport::node_path
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/pretty.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs
index 87f7f2fdb48..d92f3aafa1c 100644
--- a/src/librustc_driver/pretty.rs
+++ b/src/librustc_driver/pretty.rs
@@ -253,10 +253,9 @@ trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
     fn pp_ann<'a>(&'a self) -> &'a dyn pprust_hir::PpAnn;
 
     /// Computes an user-readable representation of a path, if possible.
-    fn node_path(&self, id: ast::NodeId) -> Option<String> {
+    fn node_path(&self, id: hir::HirId) -> Option<String> {
         self.hir_map().and_then(|map| {
-            let hir_id = map.node_to_hir_id(id);
-            map.def_path_from_hir_id(hir_id)
+            map.def_path_from_hir_id(id)
         }).map(|path| {
             path.data
                 .into_iter()
@@ -471,8 +470,8 @@ impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
         self
     }
 
-    fn node_path(&self, id: ast::NodeId) -> Option<String> {
-        Some(self.tcx.def_path_str(self.tcx.hir().local_def_id(id)))
+    fn node_path(&self, id: hir::HirId) -> Option<String> {
+        Some(self.tcx.def_path_str(self.tcx.hir().local_def_id_from_hir_id(id)))
     }
 }
 
@@ -834,7 +833,7 @@ pub fn print_after_hir_lowering<'tcx>(
                         let node = hir_map.get(hir_id);
                         pp_state.print_node(node)?;
                         pp_state.s.space()?;
-                        let path = annotation.node_path(node_id)
+                        let path = annotation.node_path(hir_id)
                             .expect("-Z unpretty missing node paths");
                         pp_state.synth_comment(path)?;
                         pp_state.s.hardbreak()?;