Skip to content

Commit c40cb21

Browse files
committed
Correctly get source for metadata crate type;
replace `unwrap()` with `expect()`
1 parent 6f10e2f commit c40cb21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_metadata/creader.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ impl<'a> CrateLoader<'a> {
236236
// path (this is a top-level dependency) as we don't want to
237237
// implicitly load anything inside the dependency lookup path.
238238
let prev_kind = source.dylib.as_ref().or(source.rlib.as_ref())
239-
.unwrap().1;
239+
.or(source.rmeta.as_ref())
240+
.expect("No sources for crate").1;
240241
if ret.is_none() && (prev_kind == kind || prev_kind == PathKind::All) {
241242
ret = Some(cnum);
242243
}

0 commit comments

Comments
 (0)