Skip to content

Commit 1e7faef

Browse files
committed
rustc_mir: buffer -Zdump-mir output instead of pestering the kernel constantly.
1 parent 61dced1 commit 1e7faef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/util/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ pub(crate) fn create_dump_file(
227227
pass_name: &str,
228228
disambiguator: &dyn Display,
229229
source: MirSource<'tcx>,
230-
) -> io::Result<fs::File> {
230+
) -> io::Result<io::BufWriter<fs::File>> {
231231
let file_path = dump_path(tcx, extension, pass_num, pass_name, disambiguator, source);
232232
if let Some(parent) = file_path.parent() {
233233
fs::create_dir_all(parent)?;
234234
}
235-
fs::File::create(&file_path)
235+
Ok(io::BufWriter::new(fs::File::create(&file_path)?))
236236
}
237237

238238
/// Write out a human-readable textual representation for the given MIR.

0 commit comments

Comments
 (0)