Skip to content

Commit 1ac338c

Browse files
committed
rustc_driver: fix compilation
1 parent 0389cc6 commit 1ac338c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustc_driver/pretty.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,16 @@ impl fold::Folder for ReplaceBodyWithLoop {
696696

697697
fn print_flowgraph<'a, 'tcx, W: Write>(variants: Vec<borrowck_dot::Variant>,
698698
tcx: TyCtxt<'a, 'tcx, 'tcx>,
699-
code: blocks::Code,
699+
code: blocks::Code<'tcx>,
700700
mode: PpFlowGraphMode,
701701
mut out: W)
702702
-> io::Result<()> {
703703
let cfg = match code {
704704
blocks::Code::Expr(expr) => cfg::CFG::new(tcx, expr),
705-
blocks::Code::FnLike(fn_like) => cfg::CFG::new(tcx, fn_like.body()),
705+
blocks::Code::FnLike(fn_like) => {
706+
let body = tcx.map.expr(fn_like.body());
707+
cfg::CFG::new(tcx, body)
708+
},
706709
};
707710
let labelled_edges = mode != PpFlowGraphMode::UnlabelledEdges;
708711
let lcfg = LabelledCFG {

0 commit comments

Comments
 (0)