Add help for E0514
This commit is contained in:
parent
3af60f831f
commit
fd4e7a0e1a
1 changed files with 10 additions and 8 deletions
|
@ -259,14 +259,16 @@ impl<'a> CrateReader<'a> {
|
||||||
metadata: &MetadataBlob) {
|
metadata: &MetadataBlob) {
|
||||||
let crate_rustc_version = decoder::crate_rustc_version(metadata.as_slice());
|
let crate_rustc_version = decoder::crate_rustc_version(metadata.as_slice());
|
||||||
if crate_rustc_version != Some(rustc_version()) {
|
if crate_rustc_version != Some(rustc_version()) {
|
||||||
span_fatal!(self.sess, span, E0514,
|
let mut err = struct_span_fatal!(self.sess, span, E0514,
|
||||||
"the crate `{}` has been compiled with {}, which is \
|
"the crate `{}` has been compiled with {}, which is \
|
||||||
incompatible with this version of rustc",
|
incompatible with this version of rustc",
|
||||||
name,
|
name,
|
||||||
crate_rustc_version
|
crate_rustc_version
|
||||||
.as_ref().map(|s| &**s)
|
.as_ref().map(|s| &**s)
|
||||||
.unwrap_or("an old version of rustc")
|
.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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue