Skip to content

Commit 9b3af6c

Browse files
committed
rewrite write_mir_fn_graphviz to cope with non-global tcx
1 parent d9fb792 commit 9b3af6c

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/librustc_mir/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2525
#![feature(placement_in_syntax)]
2626
#![feature(collection_placement)]
2727
#![feature(nonzero)]
28+
#![feature(underscore_lifetimes)]
2829

2930
#[macro_use]
3031
extern crate bitflags;

src/librustc_mir/util/graphviz.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use rustc_data_structures::indexed_vec::Idx;
2121
use super::pretty::dump_mir_def_ids;
2222

2323
/// Write a graphviz DOT graph of a list of MIRs.
24-
pub fn write_mir_graphviz<'a, 'tcx, W>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
25-
single: Option<DefId>,
26-
w: &mut W)
27-
-> io::Result<()>
24+
pub fn write_mir_graphviz<'tcx, W>(tcx: TyCtxt<'_, '_, 'tcx>,
25+
single: Option<DefId>,
26+
w: &mut W)
27+
-> io::Result<()>
2828
where W: Write
2929
{
3030
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>,
3636
}
3737

3838
/// Write a graphviz DOT graph of the MIR.
39-
pub fn write_mir_fn_graphviz<'a, 'tcx, W>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
40-
nodeid: NodeId,
41-
mir: &Mir,
42-
w: &mut W) -> io::Result<()>
39+
pub fn write_mir_fn_graphviz<'tcx, W>(tcx: TyCtxt<'_, '_, 'tcx>,
40+
nodeid: NodeId,
41+
mir: &Mir,
42+
w: &mut W) -> io::Result<()>
4343
where W: Write
4444
{
4545
writeln!(w, "digraph Mir_{} {{", nodeid)?;
@@ -137,11 +137,11 @@ fn write_edges<W: Write>(source: BasicBlock, mir: &Mir, w: &mut W) -> io::Result
137137
/// Write the graphviz DOT label for the overall graph. This is essentially a block of text that
138138
/// will appear below the graph, showing the type of the `fn` this MIR represents and the types of
139139
/// all the variables and temporaries.
140-
fn write_graph_label<'a, 'tcx, W: Write>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
141-
nid: NodeId,
142-
mir: &Mir,
143-
w: &mut W)
144-
-> io::Result<()> {
140+
fn write_graph_label<'a, 'gcx, 'tcx, W: Write>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
141+
nid: NodeId,
142+
mir: &Mir,
143+
w: &mut W)
144+
-> io::Result<()> {
145145
write!(w, " label=<fn {}(", dot::escape_html(&tcx.node_path_str(nid)))?;
146146

147147
// fn argument types.

0 commit comments

Comments
 (0)