]> git.lizzy.rs Git - rust.git/commit
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)
commite7da61975f168ff91c55233f489923fa1acd47e9
tree5a5b73a10502641b3fb082ece6014844b61919cc
parent050499c407218fb6b0044bc4a16ffbfb906ec3a4
parent992203b9764c7e4e48ca454aa3162ee7d73cb87c
Rollup merge of #37328 - michaelwoerister:stable-local-symbol-names, r=nagisa

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.