summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0461.md
blob: 33105c43ccfe7391c48424c4ed6b387370141c7e (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
Couldn't find crate `..` with expected target triple `..`.

Example of erroneous code:

`a.rs`
```ignore (cannot-link-with-other-tests)
#![crate_type = "lib"]

fn foo() {}
```

`main.rs`
```ignore (cannot-link-with-other-tests)
extern crate a;

fn main() {
    a::foo();
}
```

`a.rs` is then compiled with `--target powerpc-unknown-linux-gnu` and `b.rs`
with `--target x86_64-unknown-linux-gnu`. `a.rs` is compiled into a binary
format incompatible with `b.rs`; PowerPC and x86 are totally different
architectures. This issue also extends to any difference in target triples, as
`std` is operating-system specific.

This error can be fixed by:
 * Using [Cargo](../cargo/index.html), the Rust package manager, automatically
   fixing this issue.
 * Recompiling either crate so that they target a consistent target triple.