diff options
| author | bors <bors@rust-lang.org> | 2021-11-19 11:50:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-19 11:50:51 +0000 |
| commit | 18fa4342fc215fe9e714307db694eaa8f5dc4a0d (patch) | |
| tree | b6dd835a1306d3334d325c5e4e107e6e7d40b4d6 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | e8423e6c449ad3f4b0dab442175462004554e499 (diff) | |
| parent | 78b5f2d2faf490ab8799188a8e8bf9ead4906490 (diff) | |
| download | rust-18fa4342fc215fe9e714307db694eaa8f5dc4a0d.tar.gz rust-18fa4342fc215fe9e714307db694eaa8f5dc4a0d.zip | |
Auto merge of #90996 - the8472:obligation-hashes2, r=matthewjasper
Optimize `impl Hash for ObligationCauseData` by not hashing `ObligationCauseCode` variant fields Split out from #90913 since it's a [clear performance win](https://perf.rust-lang.org/compare.html?start=ad442399756573dccacb314b6bf8079964bcc72a&end=223f5e877fe93b5f437c2d703f883797913cd2b7) and should be easier to review. It speeds up hashing for `Obligation` [deduplication](https://github.com/rust-lang/rust/blob/c9c4b5d7276297679387189d96a952f2b760e7ad/compiler/rustc_trait_selection/src/traits/select/mod.rs#L2355-L2356) by only hashing the discriminant of the `ObligationCauseCode` enum instead of its contents. That shouldn't affect hash quality much since there are several other fields in `Obligation` which should be unique enough, especially the predicate itself which is hashed as an interned pointer.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
