Skip to content

Commit 726519d

Browse files
committed
docs: add long-form error docs for E0514
1 parent da7fcc7 commit 726519d

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

compiler/rustc_error_codes/src/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ E0509: include_str!("./error_codes/E0509.md"),
276276
E0510: include_str!("./error_codes/E0510.md"),
277277
E0511: include_str!("./error_codes/E0511.md"),
278278
E0512: include_str!("./error_codes/E0512.md"),
279+
E0514: include_str!("./error_codes/E0514.md"),
279280
E0515: include_str!("./error_codes/E0515.md"),
280281
E0516: include_str!("./error_codes/E0516.md"),
281282
E0517: include_str!("./error_codes/E0517.md"),
@@ -616,7 +617,6 @@ E0791: include_str!("./error_codes/E0791.md"),
616617
// E0488, // lifetime of variable does not enclose its declaration
617618
// E0489, // type/lifetime parameter not in scope here
618619
E0490, // a value of type `..` is borrowed for too long
619-
E0514, // metadata version mismatch
620620
E0523, // two dependencies have same (crate-name, disambiguator) but different SVH
621621
// E0526, // shuffle indices are not constant
622622
// E0540, // multiple rustc_deprecated attributes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Dependency compiled with different version of `rustc`.
2+
3+
Example of erroneous code:
4+
5+
`a.rs`
6+
```ignore (cannot-link-with-other-tests)
7+
// compiled with stable `rustc`
8+
9+
#[crate_type = "lib"]
10+
```
11+
12+
`b.rs`
13+
```ignore (cannot-link-with-other-tests)
14+
// compiled with nightly `rustc`
15+
16+
#[crate_type = "lib"]
17+
18+
extern crate a; // error: found crate `a` compiled by an incompatible version
19+
// of rustc
20+
```
21+
22+
This error is caused when the version of `rustc` used to compile a crate, as
23+
stored in the binary's metadata, differs from the version of one of its
24+
dependencies. Many parts of Rust binaries are considered unstable. For
25+
instance, the Rust ABI is not stable between compiler versions. This means that
26+
the compiler cannot be sure about *how* to call a function between compiler
27+
versions, and therefore this error occurs.
28+
29+
This error can be fixed by:
30+
* Using [Cargo](../cargo/index.html), the Rust package manager and
31+
[Rustup](https://rust-lang.github.io/rustup/), the Rust toolchain installer,
32+
automatically fixing this issue.
33+
* Recompiling the crates with a uniform `rustc` version.

0 commit comments

Comments
 (0)