Skip to content

Commit b940f50

Browse files
committed
fix #107822, handle properly when there is no crate attrs
1 parent a00e24d commit b940f50

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+1
-1
lines changed

compiler/rustc_driver_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ fn print_crate_info(
628628
println!("{}", serde_json::to_string_pretty(&sess.target.to_json()).unwrap());
629629
}
630630
FileNames | CrateName => {
631-
let attrs = attrs.as_ref().unwrap();
631+
let Some(attrs) = attrs.as_ref() else { return Compilation::Continue; };
632632
let t_outputs = rustc_interface::util::build_output_filenames(attrs, sess);
633633
let id = rustc_session::output::find_crate_name(sess, attrs);
634634
if *req == PrintRequest::CrateName {

0 commit comments

Comments
 (0)