From 992feab697ee51d9bd89e693c5106c6cbf0b0a12 Mon Sep 17 00:00:00 2001 From: Corey Richardson Date: Tue, 29 Dec 2015 00:11:52 -0500 Subject: [PATCH] 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. --- src/librustc_metadata/loader.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_metadata/loader.rs b/src/librustc_metadata/loader.rs index 81788e08c7ef2..d1892b87f8bcc 100644 --- a/src/librustc_metadata/loader.rs +++ b/src/librustc_metadata/loader.rs @@ -664,6 +664,8 @@ impl<'a> Context<'a> { } sess.err(&format!("extern location for {} is of an unknown type: {}", self.crate_name, loc.display())); + sess.help(&format!("file name should be lib*.rlib or {}*.{}", + dylibname.0, dylibname.1)); false });