rustc_middle::mir::pretty

Function dump_mir

source
pub fn dump_mir<'tcx, F>(
    tcx: TyCtxt<'tcx>,
    pass_num: bool,
    pass_name: &str,
    disambiguator: &dyn Display,
    body: &Body<'tcx>,
    extra_data: F,
)
where F: FnMut(PassWhere, &mut dyn Write) -> Result<()>,
Expand description

If the session is properly configured, dumps a human-readable representation of the MIR (with default pretty-printing options) into:

rustc.node<node_id>.<pass_num>.<pass_name>.<disambiguator>

Output from this function is controlled by passing -Z dump-mir=<filter>, where <filter> takes the following forms:

  • all – dump MIR for all fns, all passes, all everything
  • a filter defined by a set of substrings combined with & and | (& has higher precedence). At least one of the |-separated groups must match; an |-separated group matches if all of its &-separated substrings are matched.

Example:

  • nll == match if nll appears in the name
  • foo & nll == match if foo and nll both appear in the name
  • foo & nll | typeck == match if foo and nll both appear in the name or typeck appears in the name.
  • foo & nll | bar & typeck == match if foo and nll both appear in the name or typeck and bar both appear in the name.