use rustc_index::bit_set::BitSet;
use rustc_index::vec::{Idx, IndexVec};
use std::fs;
-use std::io::{self, Write};
+use std::io::{self, BufWriter, Write};
use std::path::{Path, PathBuf};
pub type LiveVarSet = BitSet<Local>;
let item_id = tcx.hir().as_local_hir_id(source.def_id()).unwrap();
let file_name = format!("rustc.node{}{}-liveness.mir", item_id, pass_name);
file_path.push(&file_name);
- let _ = fs::File::create(&file_path).and_then(|mut file| {
+ let _ = fs::File::create(&file_path).and_then(|file| {
+ let mut file = BufWriter::new(file);
writeln!(file, "// MIR local liveness analysis for `{}`", node_path)?;
writeln!(file, "// source = {:?}", source)?;
writeln!(file, "// pass_name = {}", pass_name)?;