From ac743dd5d36a5007133e9c32fed8cfb484287ab7 Mon Sep 17 00:00:00 2001 From: scottmcm Date: Wed, 22 May 2024 07:44:23 -0700 Subject: [PATCH] Use BuildHasher::hash_one (#8677) --- cranelift/src/souper_harvest.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cranelift/src/souper_harvest.rs b/cranelift/src/souper_harvest.rs index 8aeb50a12ce7..d8a559c437c7 100644 --- a/cranelift/src/souper_harvest.rs +++ b/cranelift/src/souper_harvest.rs @@ -7,6 +7,7 @@ use cranelift_codegen::Context; use cranelift_reader::parse_sets_and_triple; use rayon::iter::{IntoParallelIterator, ParallelBridge, ParallelIterator}; use std::collections::HashSet; +use std::hash::{BuildHasher, BuildHasherDefault}; use std::io::Write; use std::path::PathBuf; use std::{fs, io}; @@ -143,7 +144,5 @@ fn parse_input(path: PathBuf) -> Result> { /// A convenience function for a quick usize hash #[inline] pub fn hash(v: &T) -> usize { - let mut state = rustc_hash::FxHasher::default(); - v.hash(&mut state); - std::hash::Hasher::finish(&state) as usize + BuildHasherDefault::::default().hash_one(v) as usize }