Closed
Description
Otherwise with -Zsymbol-mangling-version=v0
and no -Cmetadata
, symbols from the same crate compiled with different versions of rustc are named the same. This makes it possible to replace a rust dylib compiled with one version of rustc with one compiled by another version of rustc even if the ABI doesn't match.
The crate disambiguator is calculated at
rust/compiler/rustc_interface/src/util.rs
Lines 500 to 531 in 354cc75
option_env!("CFG_VERSION").unwrap_or("unknown version")
in the hash. This matches what the version info included in the rustc metadata header.