Skip to content

Commit f33ea41

Browse files
authored
Rollup merge of #106028 - Ezrashaw:add-docs+test-e0461, r=GuillaumeGomez
docs/test: add UI test and long-form error docs for `E0461` Might take a couple of tries to pass CI. The UI test is x86-linux only; I'm not sure how to generalize it to other architectures. r? ``@GuillaumeGomez``
2 parents 6a20f7d + f66e752 commit f33ea41

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

compiler/rustc_error_codes/src/error_codes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ E0457: include_str!("./error_codes/E0457.md"),
244244
E0458: include_str!("./error_codes/E0458.md"),
245245
E0459: include_str!("./error_codes/E0459.md"),
246246
E0460: include_str!("./error_codes/E0460.md"),
247+
E0461: include_str!("./error_codes/E0461.md"),
247248
E0462: include_str!("./error_codes/E0462.md"),
248249
E0463: include_str!("./error_codes/E0463.md"),
249250
E0464: include_str!("./error_codes/E0464.md"),
@@ -595,7 +596,6 @@ E0791: include_str!("./error_codes/E0791.md"),
595596
// E0421, // merged into 531
596597
// E0427, // merged into 530
597598
// E0456, // plugin `..` is not available for triple `..`
598-
E0461, // couldn't find crate `..` with expected target triple ..
599599
E0465, // multiple .. candidates for `..` found
600600
// E0467, // removed
601601
// E0470, // removed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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.

0 commit comments

Comments
 (0)