6 ms·
Okay I just properly took a look at this, and some of the sibling responses are only partially correct. It's not symbol names that change, but the crate does ap
by eddyb 9y ago
Okay I just properly took a look at this, and some of the sibling responses are only partially correct. It's not symbol names that change, but the crate does appear to have a hash used to sanity-check against this.
I used these sources:
// a.rs
#![crate_type = "lib"]
pub struct Foo { pub x: i32 }
// b.rs
#![crate_type = "lib"]
extern crate a;
pub fn foo() -> a::Foo { a::Foo {} }
// c.rs
extern crate b;
fn main() {
println!("{}", b::foo().x);
}
The field `x` from crate `a` was originally not there, and added after compiling crate `b`. The error when trying to compile crate `c` was:
error[E0460]: found possibly newer version of crate `a` which `b` depends on
--> c.rs:1:1
|
1 | extern crate b;
| ^^^^^^^^^^^^^^^
|
= note: perhaps that crate needs to be recompiled?
= note: crate `a` path #1: liba.rlib
= note: crate `b` path #1: libb.rlib