]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)
committerGitHub <noreply@github.com>
Mon, 24 Oct 2016 22:41:29 +0000 (15:41 -0700)
trans: Make names of internal symbols independent of CGU translation order

Every codegen unit gets its own local counter for generating new symbol names. This makes bitcode and object files reproducible at the binary level even when incremental compilation is used.

The PR also solves a rare ICE resulting from a naming conflict between a user defined name and a generated one. E.g. try compiling the following program with 1.12.1 stable:
```rust

pub fn str7233() -> &'static str { "foo" }
```
This results in:
> error: internal compiler error: ../src/librustc_trans/common.rs:979: symbol `str7233` is already defined

Running into this is not very likely but it's also easily avoidable.


Trivial merge