mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove Clone impl for StableHashingContext.
`HashStable::hash_stable` takes a `&mut Hcx`. In contrast, `ToStableHashKey::to_stable_hash_key` takes a `&Hcx`. But there are some places where the latter calls the former, and due to the mismatch a `clone` call is required to get a mutable `StableHashingContext`. This commit changes `to_stable_hash_key` to instead take a `&mut Hcx`. This eliminates the mismatch, the need for the clones, and the need for the `Clone` impls.
This commit is contained in:
@@ -175,8 +175,8 @@ fn exported_non_generic_symbols_provider_local<'tcx>(
|
||||
|
||||
// FIXME: Sorting this is unnecessary since we are sorting later anyway.
|
||||
// Can we skip the later sorting?
|
||||
let sorted = tcx.with_stable_hashing_context(|hcx| {
|
||||
tcx.reachable_non_generics(LOCAL_CRATE).to_sorted(&hcx, true)
|
||||
let sorted = tcx.with_stable_hashing_context(|mut hcx| {
|
||||
tcx.reachable_non_generics(LOCAL_CRATE).to_sorted(&mut hcx, true)
|
||||
});
|
||||
|
||||
let mut symbols: Vec<_> =
|
||||
|
||||
Reference in New Issue
Block a user