mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
rustc: Hash the CMH into symbol names
This commit is contained in:
parent
0094ffd99b
commit
a6e748a1d9
@ -420,8 +420,7 @@ fn symbol_hash(tcx: ty::ctxt, sha: sha1, t: ty::t, link_meta: link_meta) ->
|
||||
sha.reset();
|
||||
sha.input_str(link_meta.name);
|
||||
sha.input_str("-");
|
||||
// FIXME: This wants to be link_meta.meta_hash
|
||||
sha.input_str(link_meta.name);
|
||||
sha.input_str(link_meta.extras_hash);
|
||||
sha.input_str("-");
|
||||
sha.input_str(encoder::encoded_ty(tcx, t));
|
||||
let hash = truncated_sha1_result(sha);
|
||||
|
7
src/test/auxiliary/crateresolve6-1.rs
Normal file
7
src/test/auxiliary/crateresolve6-1.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[link(name = "crateresolve6",
|
||||
vers = "0.1",
|
||||
calories = "100")];
|
||||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
fn f() -> int { 100 }
|
7
src/test/auxiliary/crateresolve6-2.rs
Normal file
7
src/test/auxiliary/crateresolve6-2.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#[link(name = "crateresolve6",
|
||||
vers = "0.1",
|
||||
calories = "200")];
|
||||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
fn f() -> int { 200 }
|
13
src/test/run-pass/crateresolve6.rs
Normal file
13
src/test/run-pass/crateresolve6.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// xfail-fast
|
||||
// aux-build:crateresolve6-1.rs
|
||||
// aux-build:crateresolve6-2.rs
|
||||
// error-pattern:mismatched types
|
||||
|
||||
// These both have the same version but differ in other metadata
|
||||
use cr6_1 (name = "crateresolve6", vers = "0.1", calories="100");
|
||||
use cr6_2 (name = "crateresolve6", vers = "0.1", calories="200");
|
||||
|
||||
fn main() {
|
||||
assert cr6_1::f() == 100;
|
||||
assert cr6_2::f() == 200;
|
||||
}
|
Loading…
Reference in New Issue
Block a user