From 5659cc57e96a858ce57380553d2cae8f6da6ec5f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 17 Nov 2023 13:45:30 +1100 Subject: Factor out two `print_crate_info` calls. --- compiler/rustc_driver_impl/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_driver_impl/src') diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 9c1a5d50230..a2e78336e71 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -373,15 +373,16 @@ fn run_compiler( let handler = EarlyErrorHandler::new(sess.opts.error_format); + let should_stop = print_crate_info(&handler, codegen_backend, sess, has_input); + if !has_input { - let should_stop = print_crate_info(&handler, codegen_backend, sess, false); if should_stop == Compilation::Continue { handler.early_error("no input filename given") } return sess.compile_status(); } - let should_stop = print_crate_info(&handler, codegen_backend, sess, true) + let should_stop = should_stop .and_then(|| list_metadata(&handler, sess, &*codegen_backend.metadata_loader())) .and_then(|| try_process_rlink(sess, compiler)); -- cgit 1.4.1-3-g733a5