]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_driver/pretty.rs
fix bug in hir,identified
[rust.git] / src / librustc_driver / pretty.rs
index 4e198a44b94831848ffde0c9758e8c70585b3b65..a30c437197c3b1e930fba1dfb148a78e7f667290 100644 (file)
@@ -91,7 +91,7 @@ pub fn parse_pretty(sess: &Session,
         ("expanded,identified", _) => PpmSource(PpmExpandedIdentified),
         ("expanded,hygiene", _) => PpmSource(PpmExpandedHygiene),
         ("hir", true)       => PpmHir(PpmNormal),
-        ("hir,identified", true) => PpmHir(PpmExpandedIdentified),
+        ("hir,identified", true) => PpmHir(PpmIdentified),
         ("hir,typed", true)        => PpmHir(PpmTyped),
         ("flowgraph", true)    => PpmFlowGraph(PpFlowGraphMode::Default),
         ("flowgraph,unlabelled", true)    => PpmFlowGraph(PpFlowGraphMode::UnlabelledEdges),
@@ -158,7 +158,7 @@ fn call_with_pp_support_hir<'tcx, A, B, F>(&self,
                                                sess: &'tcx Session,
                                                ast_map: &hir_map::Map<'tcx>,
                                                arenas: &'tcx ty::CtxtArenas<'tcx>,
-                                               id: String,
+                                               id: &str,
                                                payload: B,
                                                f: F) -> A where
         F: FnOnce(&HirPrinterSupport, B, &hir::Crate) -> A,
@@ -224,12 +224,12 @@ trait HirPrinterSupport<'ast>: pprust_hir::PpAnn {
     fn pp_ann<'a>(&'a self) -> &'a pprust_hir::PpAnn;
 }
 
-struct NoAnn<'ast, 'tcx> {
-    sess: &'tcx Session,
+struct NoAnn<'ast> {
+    sess: &'ast Session,
     ast_map: Option<hir_map::Map<'ast>>
 }
 
-impl<'ast, 'tcx> PrinterSupport<'ast> for NoAnn<'ast, 'tcx> {
+impl<'ast> PrinterSupport<'ast> for NoAnn<'ast> {
     fn sess<'a>(&'a self) -> &'a Session { self.sess }
 
     fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
@@ -239,7 +239,7 @@ fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
     fn pp_ann<'a>(&'a self) -> &'a pprust::PpAnn { self }
 }
 
-impl<'ast, 'tcx> HirPrinterSupport<'ast> for NoAnn<'ast, 'tcx> {
+impl<'ast> HirPrinterSupport<'ast> for NoAnn<'ast> {
     fn sess<'a>(&'a self) -> &'a Session { self.sess }
 
     fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
@@ -249,15 +249,15 @@ fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
     fn pp_ann<'a>(&'a self) -> &'a pprust_hir::PpAnn { self }
 }
 
-impl<'ast, 'tcx> pprust::PpAnn for NoAnn<'ast, 'tcx> {}
-impl<'ast, 'tcx> pprust_hir::PpAnn for NoAnn<'ast, 'tcx> {}
+impl<'ast> pprust::PpAnn for NoAnn<'ast> {}
+impl<'ast> pprust_hir::PpAnn for NoAnn<'ast> {}
 
-struct IdentifiedAnnotation<'ast, 'tcx> {
-    sess: &'tcx Session,
+struct IdentifiedAnnotation<'ast> {
+    sess: &'ast Session,
     ast_map: Option<hir_map::Map<'ast>>,
 }
 
-impl<'ast, 'tcx> PrinterSupport<'ast> for IdentifiedAnnotation<'ast, 'tcx> {
+impl<'ast> PrinterSupport<'ast> for IdentifiedAnnotation<'ast> {
     fn sess<'a>(&'a self) -> &'a Session { self.sess }
 
     fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
@@ -267,7 +267,7 @@ fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
     fn pp_ann<'a>(&'a self) -> &'a pprust::PpAnn { self }
 }
 
-impl<'ast, 'tcx> pprust::PpAnn for IdentifiedAnnotation<'ast, 'tcx> {
+impl<'ast> pprust::PpAnn for IdentifiedAnnotation<'ast> {
     fn pre(&self,
            s: &mut pprust::State,
            node: pprust::AnnNode) -> io::Result<()> {
@@ -307,7 +307,7 @@ fn post(&self,
     }
 }
 
-impl<'ast, 'tcx> HirPrinterSupport<'ast> for IdentifiedAnnotation<'ast, 'tcx> {
+impl<'ast> HirPrinterSupport<'ast> for IdentifiedAnnotation<'ast> {
     fn sess<'a>(&'a self) -> &'a Session { self.sess }
 
     fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
@@ -317,7 +317,7 @@ fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
     fn pp_ann<'a>(&'a self) -> &'a pprust_hir::PpAnn { self }
 }
 
-impl<'ast, 'tcx> pprust_hir::PpAnn for IdentifiedAnnotation<'ast, 'tcx> {
+impl<'ast> pprust_hir::PpAnn for IdentifiedAnnotation<'ast> {
     fn pre(&self,
            s: &mut pprust_hir::State,
            node: pprust_hir::AnnNode) -> io::Result<()> {
@@ -356,12 +356,12 @@ fn post(&self,
     }
 }
 
-struct HygieneAnnotation<'ast, 'tcx> {
-    sess: &'tcx Session,
+struct HygieneAnnotation<'ast> {
+    sess: &'ast Session,
     ast_map: Option<hir_map::Map<'ast>>,
 }
 
-impl<'ast, 'tcx> PrinterSupport<'ast> for HygieneAnnotation<'ast, 'tcx> {
+impl<'ast> PrinterSupport<'ast> for HygieneAnnotation<'ast> {
     fn sess<'a>(&'a self) -> &'a Session { self.sess }
 
     fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
@@ -371,7 +371,7 @@ fn ast_map<'a>(&'a self) -> Option<&'a hir_map::Map<'ast>> {
     fn pp_ann<'a>(&'a self) -> &'a pprust::PpAnn { self }
 }
 
-impl<'ast, 'tcx> pprust::PpAnn for HygieneAnnotation<'ast, 'tcx> {
+impl<'ast> pprust::PpAnn for HygieneAnnotation<'ast> {
     fn post(&self,
             s: &mut pprust::State,
             node: pprust::AnnNode) -> io::Result<()> {
@@ -713,7 +713,7 @@ pub fn pretty_print_input(sess: Session,
         (PpmHir(s), None) => {
             let out: &mut Write = &mut out;
             s.call_with_pp_support_hir(
-                &sess, &ast_map.unwrap(), &arenas, id, box out, |annotation, out, krate| {
+                &sess, &ast_map.unwrap(), &arenas, &id, box out, |annotation, out, krate| {
                     debug!("pretty printing source code {:?}", s);
                     let sess = annotation.sess();
                     pprust_hir::print_crate(sess.codemap(),
@@ -732,7 +732,7 @@ pub fn pretty_print_input(sess: Session,
             s.call_with_pp_support_hir(&sess,
                                        &ast_map.unwrap(),
                                        &arenas,
-                                       id,
+                                       &id,
                                        (out,uii),
                                        |annotation, (out,uii), _| {
                 debug!("pretty printing source code {:?}", s);
@@ -780,7 +780,7 @@ pub fn pretty_print_input(sess: Session,
                     driver::phase_3_run_analysis_passes(&sess,
                                                         ast_map,
                                                         &arenas,
-                                                        id,
+                                                        &id,
                                                         resolve::MakeGlobMap::No,
                                                         |tcx, _| {
                         print_flowgraph(variants, tcx, code, mode, out)