Switch the majority of fxhash uses to rustc_hash which is maintained (#39168)

fxhash seems to be unmaintained (see
https://github.com/rustsec/advisory-db/issues/2185) so we should move
away from it.
Additionally, the new crate might be slightly faster.

There is still some cases depending on stylo that have the old fxhash
crate.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

Testing: Changes in Hash should really not show any bugs. And
performance should be comparable.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-06 07:19:47 +02:00 committed by GitHub
parent d67a7bad39
commit e64c53972a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 11 additions and 6 deletions

View file

@ -46,6 +46,7 @@ pixels = { path = "../pixels" }
profile_traits = { workspace = true }
range = { path = "../range" }
rayon = { workspace = true }
rustc-hash = { workspace = true }
script = { path = "../script" }
script_traits = { workspace = true }
selectors = { workspace = true }

View file

@ -8,7 +8,6 @@ use embedder_traits::UntrustedNodeAddress;
use euclid::Size2D;
use fnv::FnvHashMap;
use fonts::FontContext;
use fxhash::FxHashMap;
use layout_api::wrapper_traits::ThreadSafeLayoutNode;
use layout_api::{
IFrameSizes, ImageAnimationState, PendingImage, PendingImageState, PendingRasterizationImage,
@ -19,6 +18,7 @@ use net_traits::image_cache::{
};
use parking_lot::{Mutex, RwLock};
use pixels::RasterImage;
use rustc_hash::FxHashMap;
use script::layout_dom::ServoThreadSafeLayoutNode;
use servo_url::{ImmutableOrigin, ServoUrl};
use style::context::SharedStyleContext;

View file

@ -7,8 +7,8 @@ use std::cell::Cell;
use app_units::Au;
use base::print_tree::PrintTree;
use compositing_traits::display_list::AxesScrollSensitivity;
use fxhash::FxHashSet;
use malloc_size_of_derive::MallocSizeOf;
use rustc_hash::FxHashSet;
use style::animation::AnimationSetKey;
use style::computed_values::position::T as Position;