about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-04 19:44:14 +0000
committerbors <bors@rust-lang.org>2024-01-04 19:44:14 +0000
commit4c5ce1f0d5bf8b2ee35ff6917658ba56ef57643b (patch)
treed4ae642bdb3ae0af49c83ea1866217cc4c07581a /compiler/rustc_driver_impl
parent090d5eac722000906cc00d991f2bf052b0e388c3 (diff)
parent657937850b3fbc2668516a21c2437af45a16889d (diff)
downloadrust-4c5ce1f0d5bf8b2ee35ff6917658ba56ef57643b.tar.gz
rust-4c5ce1f0d5bf8b2ee35ff6917658ba56ef57643b.zip
Auto merge of #119578 - matthiaskrgr:rollup-42yizmx, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #117636 (add test for #117626)
 - #118704 (Promote `riscv32{im|imafc}` targets to tier 2)
 - #119184 (Switch from using `//~ERROR` annotations with `--error-format` to `error-pattern`)
 - #119325 (custom mir: make it clear what the return block is)
 - #119391 (Use Result::flatten in catch_with_exit_code)
 - #119431 (Support reg_addr register class in s390x inline assembly)
 - #119475 (Remove libtest's dylib)
 - #119532 (Make offset_of field parsing use metavariable which handles any spacing)
 - #119553 (stop feed vis when cant access for trait item)
 - #119574 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index ca6b0afc76a..2041ffefe77 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -12,6 +12,7 @@
 #![feature(lazy_cell)]
 #![feature(let_chains)]
 #![feature(panic_update_hook)]
+#![feature(result_flattening)]
 #![recursion_limit = "256"]
 #![deny(rustc::untranslatable_diagnostic)]
 #![deny(rustc::diagnostic_outside_of_impl)]
@@ -1249,8 +1250,7 @@ pub fn catch_fatal_errors<F: FnOnce() -> R, R>(f: F) -> Result<R, ErrorGuarantee
 /// Variant of `catch_fatal_errors` for the `interface::Result` return type
 /// that also computes the exit code.
 pub fn catch_with_exit_code(f: impl FnOnce() -> interface::Result<()>) -> i32 {
-    let result = catch_fatal_errors(f).and_then(|result| result);
-    match result {
+    match catch_fatal_errors(f).flatten() {
         Ok(()) => EXIT_SUCCESS,
         Err(_) => EXIT_FAILURE,
     }