("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),
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,
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>> {
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>> {
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>> {
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<()> {
}
}
-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>> {
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<()> {
}
}
-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>> {
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<()> {
(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(),
s.call_with_pp_support_hir(&sess,
&ast_map.unwrap(),
&arenas,
- id,
+ &id,
(out,uii),
|annotation, (out,uii), _| {
debug!("pretty printing source code {:?}", s);
driver::phase_3_run_analysis_passes(&sess,
ast_map,
&arenas,
- id,
+ &id,
resolve::MakeGlobMap::No,
|tcx, _| {
print_flowgraph(variants, tcx, code, mode, out)