]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0461.md
Rollup merge of #106161 - meithecatte:iter-find-position, r=Mark-Simulacrum
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0461.md
1 Couldn't find crate `..` with expected target triple `..`.
2
3 Example of erroneous code:
4
5 `a.rs`
6 ```ignore (cannot-link-with-other-tests)
7 #![crate_type = "lib"]
8
9 fn foo() {}
10 ```
11
12 `main.rs`
13 ```ignore (cannot-link-with-other-tests)
14 extern crate a;
15
16 fn main() {
17     a::foo();
18 }
19 ```
20
21 `a.rs` is then compiled with `--target powerpc-unknown-linux-gnu` and `b.rs`
22 with `--target x86_64-unknown-linux-gnu`. `a.rs` is compiled into a binary
23 format incompatible with `b.rs`; PowerPC and x86 are totally different
24 architectures. This issue also extends to any difference in target triples, as
25 `std` is operating-system specific.
26
27 This error can be fixed by:
28  * Using [Cargo](../cargo/index.html), the Rust package manager, automatically
29    fixing this issue.
30  * Recompiling either crate so that they target a consistent target triple.