diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2021-12-20 18:46:34 +0100 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2021-12-20 18:46:34 +0100 |
| commit | c695b6026ca181ab41f8ab81848df0956058afae (patch) | |
| tree | fe4851ce7953b31b4a9f32078cfafbc2ac9c3a19 /compiler/rustc_data_structures/src | |
| parent | d3848cb659105d8384c00ba384ec2f6f39c47238 (diff) | |
| download | rust-c695b6026ca181ab41f8ab81848df0956058afae.tar.gz rust-c695b6026ca181ab41f8ab81848df0956058afae.zip | |
Use hash_stable for hashing str
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/stable_hasher.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index b8ad66901c6..5e07697f0dd 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -377,9 +377,8 @@ impl<T: ?Sized + HashStable<CTX>, CTX> HashStable<CTX> for ::std::sync::Arc<T> { impl<CTX> HashStable<CTX> for str { #[inline] - fn hash_stable(&self, _: &mut CTX, hasher: &mut StableHasher) { - self.len().hash(hasher); - self.as_bytes().hash(hasher); + fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { + self.as_bytes().hash_stable(ctx, hasher); } } |
