Skip to content

Commit c695b60

Browse files
committed
Use hash_stable for hashing str
1 parent d3848cb commit c695b60

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: compiler/rustc_data_structures/src/stable_hasher.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,8 @@ impl<T: ?Sized + HashStable<CTX>, CTX> HashStable<CTX> for ::std::sync::Arc<T> {
377377

378378
impl<CTX> HashStable<CTX> for str {
379379
#[inline]
380-
fn hash_stable(&self, _: &mut CTX, hasher: &mut StableHasher) {
381-
self.len().hash(hasher);
382-
self.as_bytes().hash(hasher);
380+
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
381+
self.as_bytes().hash_stable(ctx, hasher);
383382
}
384383
}
385384

0 commit comments

Comments
 (0)