rust/compiler/rustc_metadata
Nicholas Nethercote 9570023ce1 Only compute the crate hash when necessary.
The crate hash is needed:
- if debug assertions are enabled, or
- if incr. comp. is enabled, or
- if metadata is being generated, or
- if `-C instrumentation-coverage` is enabled.

This commit avoids computing the crate hash when these conditions are
all false, such as when doing a release build of a binary crate.

It uses `Option` to store the hashes when needed, rather than
computing them on demand, because some of them are needed in multiple
places and computing them on demand would make compilation slower.

The commit also removes `Owner::hash_without_bodies`. There is no
benefit to pre-computing that one, it can just be done in the normal
fashion.
2023-03-08 09:30:22 +11:00
..
locales errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
src Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11:00
Cargo.toml rustc_metadata: Encode doc(hidden) flag to metadata 2023-01-21 22:35:20 +04:00