I am playing with Rust's LLVM backend, from where I find rust's rule of mangled name is rather confusing and remains a myth to me.
I compile libcore/lib.rs via rustc --emit=llvm-bc,llvm-ir lib.rs, from which I see core::fmt::write is mangled to _ZN4core3fmt5write17h34ec53ff1bfcf343E. Later I compile another rust source file via the same command, I get _ZN4core3fmt5write17hed5a9f5780519923E. Looks like these two mangled names have a common prefix, but what are these two different suffixes? Can I have a way to unify them?
I can't answer why the same symbol from libcore would have different hashes across invocations of the compiler, but check out this explanation which covers the role of the hash suffix and various things that factor into it.