summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0514.md
blob: ce2bbc5c5056c4a3d5748b495b4890c1536c322c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Dependency compiled with different version of `rustc`.

Example of erroneous code:

`a.rs`
```ignore (cannot-link-with-other-tests)
// compiled with stable `rustc`

#[crate_type = "lib"]
```

`b.rs`
```ignore (cannot-link-with-other-tests)
// compiled with nightly `rustc`

#[crate_type = "lib"]

extern crate a; // error: found crate `a` compiled by an incompatible version
                //        of rustc
```

This error is caused when the version of `rustc` used to compile a crate, as
stored in the binary's metadata, differs from the version of one of its
dependencies. Many parts of Rust binaries are considered unstable. For
instance, the Rust ABI is not stable between compiler versions. This means that
the compiler cannot be sure about *how* to call a function between compiler
versions, and therefore this error occurs.

This error can be fixed by:
 * Using [Cargo](../cargo/index.html), the Rust package manager and
   [Rustup](https://rust-lang.github.io/rustup/), the Rust toolchain installer,
   automatically fixing this issue.
 * Recompiling the crates with a uniform `rustc` version.