diff options
| author | bors <bors@rust-lang.org> | 2023-02-10 15:22:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-10 15:22:51 +0000 |
| commit | 3574b1a69aebccbafc49096257317bb322c67025 (patch) | |
| tree | 20698aeaed5fd97fee63afce1b52625d45b26463 /compiler/rustc_driver_impl/src/lib.rs | |
| parent | d1ac43a9b9a8250d858705b0796dfed6186e18db (diff) | |
| parent | 1e106c1cf89d55f0d118fd92bbcf145eb7a85b49 (diff) | |
| download | rust-3574b1a69aebccbafc49096257317bb322c67025.tar.gz rust-3574b1a69aebccbafc49096257317bb322c67025.zip | |
Auto merge of #107889 - matthiaskrgr:rollup-c0d4al0, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #107789 (Avoid exposing type parameters and implementation details sourced from macro expansions) - #107836 (Handle properly when there is no crate attrs) - #107839 (avoid duplicating the RUSTC_LOG env var name) - #107866 (Allow wasi-libc to initialize its environment variables lazily.) - #107876 (create symlink only for non-windows operating systems) - #107882 (Cleanup typos in en_US/borrowck.ftl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_driver_impl/src/lib.rs')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index bdf2978cee2..37967bfdff5 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -624,7 +624,10 @@ fn print_crate_info( println!("{}", serde_json::to_string_pretty(&sess.target.to_json()).unwrap()); } FileNames | CrateName => { - let attrs = attrs.as_ref().unwrap(); + let Some(attrs) = attrs.as_ref() else { + // no crate attributes, print out an error and exit + return Compilation::Continue; + }; let t_outputs = rustc_interface::util::build_output_filenames(attrs, sess); let id = rustc_session::output::find_crate_name(sess, attrs); if *req == PrintRequest::CrateName { |
