about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-10-31 12:55:54 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-10-31 12:55:54 -0400
commit9b3af6ce3c61e6076ed61b52542c037d0296f062 (patch)
treedcb3fc8aeeb01e33f7cd8c681a18bfdb82dc6b48
parentd9fb792d7c259b76e51c1cbd6a7e5f9cee27ff99 (diff)
downloadrust-9b3af6ce3c61e6076ed61b52542c037d0296f062.tar.gz
rust-9b3af6ce3c61e6076ed61b52542c037d0296f062.zip
rewrite `write_mir_fn_graphviz` to cope with non-global tcx
-rw-r--r--src/librustc_mir/lib.rs1
-rw-r--r--src/librustc_mir/util/graphviz.rs26
2 files changed, 14 insertions, 13 deletions
diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs
index 66de35bd7f5..b72823dff2b 100644
--- a/src/librustc_mir/lib.rs
+++ b/src/librustc_mir/lib.rs
@@ -25,6 +25,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
 #![feature(placement_in_syntax)]
 #![feature(collection_placement)]
 #![feature(nonzero)]
+#![feature(underscore_lifetimes)]
 
 #[macro_use]
 extern crate bitflags;
diff --git a/src/librustc_mir/util/graphviz.rs b/src/librustc_mir/util/graphviz.rs
index cec8067530b..a38d317b823 100644
--- a/src/librustc_mir/util/graphviz.rs
+++ b/src/librustc_mir/util/graphviz.rs
@@ -21,10 +21,10 @@ use rustc_data_structures::indexed_vec::Idx;
 use super::pretty::dump_mir_def_ids;
 
 /// Write a graphviz DOT graph of a list of MIRs.
-pub fn write_mir_graphviz<'a, 'tcx, W>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                       single: Option<DefId>,
-                                       w: &mut W)
-                                       -> io::Result<()>
+pub fn write_mir_graphviz<'tcx, W>(tcx: TyCtxt<'_, '_, 'tcx>,
+                                   single: Option<DefId>,
+                                   w: &mut W)
+                                   -> io::Result<()>
     where W: Write
 {
     for def_id in dump_mir_def_ids(tcx, single) {
@@ -36,10 +36,10 @@ pub fn write_mir_graphviz<'a, 'tcx, W>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 /// Write a graphviz DOT graph of the MIR.
-pub fn write_mir_fn_graphviz<'a, 'tcx, W>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                        nodeid: NodeId,
-                                        mir: &Mir,
-                                        w: &mut W) -> io::Result<()>
+pub fn write_mir_fn_graphviz<'tcx, W>(tcx: TyCtxt<'_, '_, 'tcx>,
+                                      nodeid: NodeId,
+                                      mir: &Mir,
+                                      w: &mut W) -> io::Result<()>
     where W: Write
 {
     writeln!(w, "digraph Mir_{} {{", nodeid)?;
@@ -137,11 +137,11 @@ fn write_edges<W: Write>(source: BasicBlock, mir: &Mir, w: &mut W) -> io::Result
 /// Write the graphviz DOT label for the overall graph. This is essentially a block of text that
 /// will appear below the graph, showing the type of the `fn` this MIR represents and the types of
 /// all the variables and temporaries.
-fn write_graph_label<'a, 'tcx, W: Write>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
-                                         nid: NodeId,
-                                         mir: &Mir,
-                                         w: &mut W)
-                                         -> io::Result<()> {
+fn write_graph_label<'a, 'gcx, 'tcx, W: Write>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
+                                               nid: NodeId,
+                                               mir: &Mir,
+                                               w: &mut W)
+                                               -> io::Result<()> {
     write!(w, "    label=<fn {}(", dot::escape_html(&tcx.node_path_str(nid)))?;
 
     // fn argument types.