From fd4e7a0e1a0b027465c4ea8a652f0166d2b4df85 Mon Sep 17 00:00:00 2001 From: ggomez Date: Tue, 8 Mar 2016 14:57:23 +0100 Subject: [PATCH] Add help for E0514 --- src/librustc_metadata/creader.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 35d7a0d4b9c27..d05728d11cd32 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -259,14 +259,16 @@ impl<'a> CrateReader<'a> { metadata: &MetadataBlob) { let crate_rustc_version = decoder::crate_rustc_version(metadata.as_slice()); if crate_rustc_version != Some(rustc_version()) { - span_fatal!(self.sess, span, E0514, - "the crate `{}` has been compiled with {}, which is \ - incompatible with this version of rustc", - name, - crate_rustc_version - .as_ref().map(|s| &**s) - .unwrap_or("an old version of rustc") - ); + let mut err = struct_span_fatal!(self.sess, span, E0514, + "the crate `{}` has been compiled with {}, which is \ + incompatible with this version of rustc", + name, + crate_rustc_version + .as_ref().map(|s| &**s) + .unwrap_or("an old version of rustc")); + err.fileline_help(span, "consider removing the compiled binaries and recompiling \ + with your current version of rustc"); + err.emit(); } }