Skip to content

Commit 992feab

Browse files
committed
Add a hint when given --extern with an indeterminate type
@ubsan brought up this relatively poor error message. This adds a help message hinting when the problem actually is, and how to fix it.
1 parent 27a1834 commit 992feab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc_metadata/loader.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ impl<'a> Context<'a> {
664664
}
665665
sess.err(&format!("extern location for {} is of an unknown type: {}",
666666
self.crate_name, loc.display()));
667+
sess.help(&format!("file name should be lib*.rlib or {}*.{}",
668+
dylibname.0, dylibname.1));
667669
false
668670
});
669671

0 commit comments

Comments
 (0)