You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0400592
Browse filesBrowse the repository at this point in the historyBrowse files
Rollup merge of #165578 - Zalathar:hash, r=adwinwhite
Avoid `Hash::hash` when stable-hashing various types
This PR makes StableHash independent of stdlib-dependent Hash impls for several types, to avoid potential inconsistency in stable hashing between stage1 and stage2 compilers.
This covers all of the StableHash impls that I'm aware of. However, there are still various other places in the compiler where we rely on `Hash::hash` for hashes that probably should be made consistent between compiler stages.
/// This trait lets `StableHash` and `derive(StableHash)` be used in
22
21
/// this crate (and other crates upstream of `rustc_middle`), while leaving
23
22
/// certain operations to be defined in `rustc_middle` where more things are
@@ -186,29 +185,20 @@ impl<T: StableOrd> StableCompare for T {
186
185
}
187
186
}
188
187
189
-
/// Implement StableHash by just calling `Hash::hash()`. Also implement `StableOrd` for the type
190
-
/// since that has the same requirements.
191
-
///
192
-
/// **WARNING** This is only valid for types that *really* don't need any context for fingerprinting.
193
-
/// But it is easy to misuse this macro (see [#96013](https://github.com/rust-lang/rust/issues/96013)
194
-
/// for examples). Therefore this macro is not exported and should only be used in the limited cases
0 commit comments