rust/compiler/rustc_middle
bors 18fa4342fc 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](c9c4b5d727/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.
2021-11-19 11:50:51 +00:00
..
benches mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
src Auto merge of #90996 - the8472:obligation-hashes2, r=matthewjasper 2021-11-19 11:50:51 +00:00
Cargo.toml Store lowering outputs per owner. 2021-10-09 11:56:29 +02:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

For more information about how rustc works, see the rustc dev guide.