Skip to content

Commit 2b9438a

Browse files
committed
Auto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr
Add help for E0514 I fixed #30622. r? @arielb1
2 parents c6a6053 + fd4e7a0 commit 2b9438a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/librustc_metadata/creader.rs

+10-8
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,16 @@ impl<'a> CrateReader<'a> {
259259
metadata: &MetadataBlob) {
260260
let crate_rustc_version = decoder::crate_rustc_version(metadata.as_slice());
261261
if crate_rustc_version != Some(rustc_version()) {
262-
span_fatal!(self.sess, span, E0514,
263-
"the crate `{}` has been compiled with {}, which is \
264-
incompatible with this version of rustc",
265-
name,
266-
crate_rustc_version
267-
.as_ref().map(|s| &**s)
268-
.unwrap_or("an old version of rustc")
269-
);
262+
let mut err = struct_span_fatal!(self.sess, span, E0514,
263+
"the crate `{}` has been compiled with {}, which is \
264+
incompatible with this version of rustc",
265+
name,
266+
crate_rustc_version
267+
.as_ref().map(|s| &**s)
268+
.unwrap_or("an old version of rustc"));
269+
err.fileline_help(span, "consider removing the compiled binaries and recompiling \
270+
with your current version of rustc");
271+
err.emit();
270272
}
271273
}
272274

0 commit comments

Comments
 (0)