Skip to content

Commit c22f154

Browse files
committed
Do not ICE for native_lib without name
1 parent 511364e commit c22f154

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_metadata/src/native_libs.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ fn find_bundled_library(
5353
sess: &Session,
5454
) -> Option<Symbol> {
5555
if let NativeLibKind::Static { bundle: Some(true) | None, whole_archive } = kind
56+
&& let Some(name) = name
5657
&& sess.crate_types().iter().any(|t| matches!(t, &CrateType::Rlib | CrateType::Staticlib))
5758
&& (sess.opts.unstable_opts.packed_bundled_libs || has_cfg || whole_archive == Some(true))
5859
{
5960
let verbatim = verbatim.unwrap_or(false);
6061
let search_paths = &sess.target_filesearch(PathKind::Native).search_path_dirs();
61-
return find_native_static_library(name.unwrap().as_str(), verbatim, search_paths, sess)
62+
return find_native_static_library(name.as_str(), verbatim, search_paths, sess)
6263
.file_name()
6364
.and_then(|s| s.to_str())
6465
.map(Symbol::intern);

0 commit comments

Comments
 (0)