Email me

Rust errors / Names, paths and imports

Rust compiler error · checked with rustc 1.99.0

Rust error E0460: found possibly newer version of crate `..` which `..` depends on

What it meansFound possibly newer version of crate .. which .. depends on.

E0460Names, paths and imports
Activein rustc 1.99.0
8related errors linked below

The compiler team's explanation

Found possibly newer version of crate .. which .. depends on.

Consider these erroneous files:

a1.rs

#![crate_name = "a"]

pub fn foo<T>() {}

a2.rs

#![crate_name = "a"]

pub fn foo<T>() {
    println!("foo<T>()");
}

b.rs

#![crate_name = "b"]

extern crate a; // linked with `a1.rs`

pub fn foo() {
    a::foo::<isize>();
}

main.rs

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:

    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.

From rustc --explain E0460 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.

Related errors

All 518 Rust error codes · Rust crate data · Glossary

Up next

Often hit nextE0425: cannot find value in this scopeA related error from the same family.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ