// Before the CFG, dump out the values for each region variable.
PassWhere::BeforeCFG => {
regioncx.dump_mir(out)?;
+ writeln!(out, "|")?;
if let Some(closure_region_requirements) = closure_region_requirements {
- writeln!(out, "|")?;
writeln!(out, "| Free Region Constraints")?;
for_each_region_constraint(closure_region_requirements, &mut |msg| {
writeln!(out, "| {}", msg)
})?;
+ writeln!(out, "|")?;
}
}
}
writeln!(file, "")?;
extra_data(PassWhere::BeforeCFG, &mut file)?;
+ write_user_type_annotations(mir, &mut file)?;
write_mir_fn(tcx, source, mir, &mut extra_data, &mut file)?;
extra_data(PassWhere::AfterCFG, &mut file)?;
};
Ok(())
}
+fn write_user_type_annotations(mir: &Mir, w: &mut dyn Write) -> io::Result<()> {
+ if !mir.user_type_annotations.is_empty() {
+ writeln!(w, "| User Type Annotations")?;
+ }
+ for (index, (span, annotation)) in mir.user_type_annotations.iter_enumerated() {
+ writeln!(w, "| {:?}: {:?} at {:?}", index.index(), annotation, span)?;
+ }
+ if !mir.user_type_annotations.is_empty() {
+ writeln!(w, "|")?;
+ }
+ Ok(())
+}
+
pub fn dump_mir_def_ids(tcx: TyCtxt, single: Option<DefId>) -> Vec<DefId> {
if let Some(i) = single {
vec![i]