Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that Fingerprint caching respects hashing configuration #92278

Merged
merged 3 commits into from
Jan 10, 2022

Commits on Jan 5, 2022

  1. Ensure that Fingerprint caching respects hashing configuration

    Fixes rust-lang#92266
    
    In some `HashStable` impls, we use a cache to avoid re-computing
    the same `Fingerprint` from the same structure (e.g. an `AdtDef`).
    However, the `StableHashingContext` used can be configured to
    perform hashing in different ways (e.g. skipping `Span`s). This
    configuration information is not included in the cache key,
    which will cause an incorrect `Fingerprint` to be used if
    we hash the same structure with different `StableHashingContext`
    settings.
    
    To fix this, the configuration settings of `StableHashingContext`
    are split out into a separate `HashingControls` struct. This
    struct is used as part of the cache key, ensuring that our caches
    always produce the correct result for the given settings.
    
    With this in place, we now turn off `Span` hashing during the
    entire process of computing the hash included in legacy symbols.
    This current has no effect, but will matter when a future PR
    starts hashing more `Span`s that we currently skip.
    Aaron1011 committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    5580e5e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    560c90f View commit details
    Browse the repository at this point in the history
  3. Address review comments

    Aaron1011 committed Jan 5, 2022
    Configuration menu
    Copy the full SHA
    4ca275a View commit details
    Browse the repository at this point in the history