Don't call closures immediately, use try{} blocks

This commit is contained in:
Maybe Waffle 2023-01-09 15:15:26 +00:00
parent bddbf38af2
commit 360e978437
10 changed files with 88 additions and 115 deletions

View file

@ -3,6 +3,7 @@
#![feature(internal_output_capture)]
#![feature(thread_spawn_unchecked)]
#![feature(once_cell)]
#![feature(try_blocks)]
#![recursion_limit = "256"]
#![allow(rustc::potential_query_instability)]
#![deny(rustc::untranslatable_diagnostic)]

View file

@ -559,7 +559,7 @@ fn write_out_deps(
}
let deps_filename = outputs.path(OutputType::DepInfo);
let result = (|| -> io::Result<()> {
let result: io::Result<()> = try {
// Build a list of files used to compile the output and
// write Makefile-compatible dependency rules
let mut files: Vec<String> = sess
@ -646,9 +646,7 @@ fn write_out_deps(
writeln!(file)?;
}
}
Ok(())
})();
};
match result {
Ok(_) => {