/// Write out a human-readable textual representation of the MIR's `fn` type and the types of its
/// local variables (both user-defined bindings and compiler temporaries).
Write out a human-readable textual representation of the MIR's `fn` type and the types of its
local variables (both user-defined bindings and compiler temporaries).
Write out a human - readable textual representation of the MIR ' s ` fn ` type and the types of its local variables ( both user - defined bindings and compiler temporaries ) .
fn write_mir_intro<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                             src: MirSource,
                             mir: &Mir,
                             w: &mut Write)
                             -> io::Result<()> {
    write_mir_sig(tcx, src, mir, w)?;
    writeln!(w, " {{")?;
    // construct a scope tree and write it out
    let mut scope_tree: FnvHashMap<VisibilityScope, Vec<VisibilityScope>> = FnvHashMap();
    for (index, scope_data) in mir.visibility_scopes.iter().enumerate() {
        if let Some(parent) = scope_data.parent_scope {
            scope_tree.entry(parent)
                      .or_insert(vec![])
                      .push(VisibilityScope::new(index));
        } else {
            // Only the argument scope has no parent, because it's the root.
            assert_eq!(index, ARGUMENT_VISIBILITY_SCOPE.index());
        }
    }
    write_scope_tree(tcx, mir, &scope_tree, w, ARGUMENT_VISIBILITY_SCOPE, 1)?;
    write_mir_decls(mir, w)
}
fn write_mir_intro < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , src : MirSource , mir : & Mir , w : & mut Write ) -> io :: Result < ( ) > { write_mir_sig ( tcx , src , mir , w ) ? ; writeln ! ( w " " ) ? ; // construct a scope tree and write it out let mut scope_tree : FnvHashMap < VisibilityScope , Vec < VisibilityScope > > = FnvHashMap ( ) ; for ( index , scope_data ) in mir . visibility_scopes . iter ( ) . enumerate ( ) { if let Some ( parent ) = scope_data . parent_scope { scope_tree . entry ( parent ) . or_insert ( vec ! [ ] ) . push ( VisibilityScope :: new ( index ) ) ; } else { // Only the argument scope has no parent, because it's the root. assert_eq ! ( index ARGUMENT_VISIBILITY_SCOPE index ( ) ) ; } } write_scope_tree ( tcx , mir , & scope_tree , w , ARGUMENT_VISIBILITY_SCOPE , 1 ) ? ; write_mir_decls ( mir , w ) }
Write out a human-readable textual representation of the MIR's `fn` type and the types of its
local variables (both user-defined bindings and compiler temporaries).
Write out a human - readable textual representation of the MIR ' s ` fn ` type and the types of its local variables ( both user - defined bindings and compiler temporaries ) .
tcx
TyCtxt<'a, 'tcx, 'tcx>
src
MirSource
mir
&Mir
w
&mut Write