mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
docs: add long-form error-code docs for E0460
This commit is contained in:
parent
ff016a55c2
commit
7e66d451ad
@ -241,6 +241,7 @@ E0454: include_str!("./error_codes/E0454.md"),
|
||||
E0455: include_str!("./error_codes/E0455.md"),
|
||||
E0458: include_str!("./error_codes/E0458.md"),
|
||||
E0459: include_str!("./error_codes/E0459.md"),
|
||||
E0460: include_str!("./error_codes/E0460.md"),
|
||||
E0463: include_str!("./error_codes/E0463.md"),
|
||||
E0464: include_str!("./error_codes/E0464.md"),
|
||||
E0466: include_str!("./error_codes/E0466.md"),
|
||||
@ -593,7 +594,6 @@ E0791: include_str!("./error_codes/E0791.md"),
|
||||
// E0427, // merged into 530
|
||||
// E0456, // plugin `..` is not available for triple `..`
|
||||
E0457, // plugin `..` only found in rlib format, but must be available...
|
||||
E0460, // found possibly newer version of crate `..`
|
||||
E0461, // couldn't find crate `..` with expected target triple ..
|
||||
E0462, // found staticlib `..` instead of rlib or dylib
|
||||
E0465, // multiple .. candidates for `..` found
|
||||
|
71
compiler/rustc_error_codes/src/error_codes/E0460.md
Normal file
71
compiler/rustc_error_codes/src/error_codes/E0460.md
Normal file
@ -0,0 +1,71 @@
|
||||
Found possibly newer version of crate `..` which `..` depends on.
|
||||
|
||||
Consider these erroneous files:
|
||||
|
||||
`a1.rs`
|
||||
```ignore (needs-linkage-with-other-tests)
|
||||
#![crate_name = "a"]
|
||||
|
||||
pub fn foo<T>() {}
|
||||
```
|
||||
|
||||
`a2.rs`
|
||||
```ignore (needs-linkage-with-other-tests)
|
||||
#![crate_name = "a"]
|
||||
|
||||
pub fn foo<T>() {
|
||||
println!("foo<T>()");
|
||||
}
|
||||
```
|
||||
|
||||
`b.rs`
|
||||
```ignore (needs-linkage-with-other-tests)
|
||||
#![crate_name = "b"]
|
||||
|
||||
extern crate a; // linked with `a1.rs`
|
||||
|
||||
pub fn foo() {
|
||||
a::foo::<isize>();
|
||||
}
|
||||
```
|
||||
|
||||
`main.rs`
|
||||
```ignore (needs-linkage-with-other-tests)
|
||||
extern crate a; // linked with `a2.rs`
|
||||
extern crate b; // error: found possibly newer version of crate `a` which `b`
|
||||
// depends on
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
The dependency graph of this program can be represented as follows:
|
||||
```text
|
||||
crate `main`
|
||||
|
|
||||
+-------------+
|
||||
| |
|
||||
| v
|
||||
depends: | crate `b`
|
||||
`a` v1 | |
|
||||
| | depends:
|
||||
| | `a` v2
|
||||
v |
|
||||
crate `a` <------+
|
||||
```
|
||||
|
||||
Crate `main` depends on crate `a` (version 1) and crate `b` which in turn
|
||||
depends on crate `a` (version 2); this discrepancy in versions cannot be
|
||||
reconciled. This difference in versions typically occurs when one crate is
|
||||
compiled and linked, then updated and linked to another crate. The crate
|
||||
"version" is a SVH (Strict Version Hash) of the crate in an
|
||||
implementation-specific way. Note that this error can *only* occur when
|
||||
directly compiling and linking with `rustc`; [Cargo] automatically resolves
|
||||
dependencies, without using the compiler's own dependency management that
|
||||
causes this issue.
|
||||
|
||||
This error can be fixed by:
|
||||
* Using [Cargo], the Rust package manager, automatically fixing this issue.
|
||||
* Recompiling crate `a` so that both crate `b` and `main` have a uniform
|
||||
version to depend on.
|
||||
|
||||
[Cargo]: ../cargo/index.html
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate b;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
@ -11,3 +11,4 @@ LL | extern crate utb;
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0460`.
|
||||
|
Loading…
Reference in New Issue
Block a user