use syntax::attr;
use syntax::ext::base::ExtCtxt;
use syntax::parse::{self, PResult};
use syntax::attr;
use syntax::ext::base::ExtCtxt;
use syntax::parse::{self, PResult};
*sess.crate_disambiguator.borrow_mut() = Some(disambiguator);
rustc_incremental::prepare_session_directory(
sess,
&crate_name,
*sess.crate_disambiguator.borrow_mut() = Some(disambiguator);
rustc_incremental::prepare_session_directory(
sess,
&crate_name,
use std::hash::Hasher;
// The crate_disambiguator is a 128 bit hash. The disambiguator is fed
// into various other hashes quite a bit (symbol hashes, incr. comp. hashes,
// debuginfo type IDs, etc), so we don't want it to be too wide. 128 bits
// should still be safe enough to avoid collisions in practice.
use std::hash::Hasher;
// The crate_disambiguator is a 128 bit hash. The disambiguator is fed
// into various other hashes quite a bit (symbol hashes, incr. comp. hashes,
// debuginfo type IDs, etc), so we don't want it to be too wide. 128 bits
// should still be safe enough to avoid collisions in practice.
let mut hasher = StableHasher::<Fingerprint>::new();
let mut metadata = session.opts.cg.metadata.clone();
let mut hasher = StableHasher::<Fingerprint>::new();
let mut metadata = session.opts.cg.metadata.clone();
- // If this is an executable, add a special suffix, so that we don't get
- // symbol conflicts when linking against a library of the same name.
+ // Also incorporate crate type, so that we don't get symbol conflicts when
+ // linking against a library of the same name, if this is an executable.