X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Futil%2Fliveness.rs;h=b12ad1e4c15cca55f8bee1d39e1690a8de49ebc9;hb=5d1433b1f401d6b2a43a5728924c3725014b8cdc;hp=1488bfe4d627a62df142a99c82de259ce98a77cc;hpb=260514da942f281bc2dc3b14b629d3e660b3484f;p=rust.git diff --git a/src/librustc_mir/util/liveness.rs b/src/librustc_mir/util/liveness.rs index 1488bfe4d62..b12ad1e4c15 100644 --- a/src/librustc_mir/util/liveness.rs +++ b/src/librustc_mir/util/liveness.rs @@ -36,7 +36,7 @@ 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; @@ -288,7 +288,8 @@ fn dump_matched_mir_node<'tcx>( 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)?;