pub fn write_mir_pretty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                  single: Option<DefId>,
                                  w: &mut Write)
                                  -> io::Result<()>
{
    writeln!(w, "// WARNING: This output format is intended for human consumers only")?;
    writeln!(w, "// and is subject to change without notice. Knock yourself out.")?;

    let mut first = true;
    for def_id in dump_mir_def_ids(tcx, single) {
        let mir = &tcx.optimized_mir(def_id);

        if first {
            first = false;
        } else {
            // Put empty lines between all items
            writeln!(w, "")?;
        }

        let id = tcx.hir.as_local_node_id(def_id).unwrap();
        let src = MirSource::from_node(tcx, id);
        write_mir_fn(tcx, src, mir, w)?;

        for (i, mir) in mir.promoted.iter_enumerated() {
            writeln!(w, "")?;
            write_mir_fn(tcx, MirSource::Promoted(id, i), mir, w)?;
        }
    }
    Ok(())
}
/// Write out a human-readable textual representation for the given MIR.
Write out a human-readable textual representation for the given MIR.
Write out a human - readable textual representation for the given MIR .
pub fn write_mir_pretty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                  single: Option<DefId>,
                                  w: &mut Write)
                                  -> io::Result<()>
{
    writeln!(w, "// WARNING: This output format is intended for human consumers only")?;
    writeln!(w, "// and is subject to change without notice. Knock yourself out.")?;
    let mut first = true;
    for def_id in dump_mir_def_ids(tcx, single) {
        let mir = &tcx.optimized_mir(def_id);
        if first {
            first = false;
        } else {
            // Put empty lines between all items
            writeln!(w, "")?;
        }
        let id = tcx.hir.as_local_node_id(def_id).unwrap();
        let src = MirSource::from_node(tcx, id);
        write_mir_fn(tcx, src, mir, w)?;
        for (i, mir) in mir.promoted.iter_enumerated() {
            writeln!(w, "")?;
            write_mir_fn(tcx, MirSource::Promoted(id, i), mir, w)?;
        }
    }
    Ok(())
}
pub fn write_mir_pretty < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , single : Option < DefId > , w : & mut Write ) -> io :: Result < ( ) > { writeln ! ( w " " ) ? ; writeln ! ( w " " ) ? ; let mut first = true ; for def_id in dump_mir_def_ids ( tcx , single ) { let mir = & tcx . optimized_mir ( def_id ) ; if first { first = false ; } else { // Put empty lines between all items writeln ! ( w " " ) ? ; } let id = tcx . hir . as_local_node_id ( def_id ) . unwrap ( ) ; let src = MirSource :: from_node ( tcx , id ) ; write_mir_fn ( tcx , src , mir , w ) ? ; for ( i , mir ) in mir . promoted . iter_enumerated ( ) { writeln ! ( w " " ) ? ; write_mir_fn ( tcx , MirSource :: Promoted ( id , i ) , mir , w ) ? ; } } Ok ( ( ) ) }
Write out a human-readable textual representation for the given MIR.
Write out a human - readable textual representation for the given MIR .
tcx
TyCtxt<'a, 'tcx, 'tcx>
single
Option<DefId>
w
&mut Write
tcx
TyCtxt<'a, 'tcx, 'tcx>
single
Option<DefId>
w
&mut Write