]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #41141 - michaelwoerister:direct-metadata-ich-final, r=nikomatsakis
authorTim Neumann <mail@timnn.me>
Wed, 12 Apr 2017 12:45:42 +0000 (14:45 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Apr 2017 12:45:42 +0000 (14:45 +0200)
commit1b006b78a6360a2fbf14cae8e7d98dab4feff905
tree411c7f90e5aa53de29a85d36dfa7bdc984768bf4
parent918e35a9bd95eab4d233aedc49168adb7c944f76
parentca2dce9b48e65ae2b286fbd10e459536ecccb2d8
Rollup merge of #41141 - michaelwoerister:direct-metadata-ich-final, r=nikomatsakis

ICH: Replace old, transitive metadata hashing with direct hashing approach.

This PR replaces the old crate metadata hashing strategy with a new one that directly (but stably) hashes all values we encode into the metadata. Previously we would track what data got accessed during metadata encoding and then hash the input nodes (HIR and upstream metadata) that were transitively reachable from the accessed data. While this strategy was sound, it had two major downsides:

1. It was susceptible to generating false positives, i.e. some input node might have changed without actually affecting the content of the metadata. That metadata entry would still show up as changed.
2. It was susceptible to quadratic blow-up when many metadata nodes shared the same input nodes, which would then get hashed over and over again.

The new method does not have these disadvantages and it's also a first step towards caching more intermediate results in the compiler.

Metadata hashing/cross-crate incremental compilation is still kept behind the `-Zincremental-cc` flag even after this PR. Once the new method has proven itself with more tests, we can remove the flag and enable cross-crate support by default again.

r? @nikomatsakis
cc @rust-lang/compiler
src/librustc_driver/driver.rs