diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 1011d40112b5..173f1815ed29 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -19,9 +19,8 @@ use platform::font_template::FontTemplateData; use smallvec::SmallVec; use std::cell::RefCell; use std::collections::HashMap; -use std::collections::hash_state::DefaultState; use std::default::Default; -use std::hash::{Hash, Hasher}; +use std::hash::{BuildHasherDefault, Hash, Hasher}; use std::rc::Rc; use std::sync::Arc; use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; @@ -86,7 +85,7 @@ pub struct FontContext { paint_font_cache: Vec, layout_font_group_cache: - HashMap, DefaultState>, + HashMap, BuildHasherDefault>, epoch: usize, } @@ -100,7 +99,7 @@ impl FontContext { layout_font_cache: vec!(), fallback_font_cache: vec!(), paint_font_cache: vec!(), - layout_font_group_cache: HashMap::with_hash_state(Default::default()), + layout_font_group_cache: HashMap::with_hasher(Default::default()), epoch: 0, } } diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index 871e210f5413..dbf255a56b46 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -10,7 +10,6 @@ #![feature(box_syntax)] #![feature(custom_attribute)] #![feature(custom_derive)] -#![feature(hashmap_hasher)] #![feature(mpsc_select)] #![feature(plugin)] #![feature(str_char)] diff --git a/components/layout/context.rs b/components/layout/context.rs index 53bb036d09cd..ec2be6f2141a 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -20,7 +20,7 @@ use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResp use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder}; use std::cell::{RefCell, RefMut}; use std::collections::HashMap; -use std::collections::hash_state::DefaultState; +use std::hash::BuildHasherDefault; use std::rc::Rc; use std::sync::mpsc::Sender; use std::sync::{Arc, Mutex}; @@ -95,7 +95,7 @@ pub struct SharedLayoutContext { pub canvas_layers_sender: Mutex)>>, /// The visible rects for each layer, as reported to us by the compositor. - pub visible_rects: Arc, DefaultState>>, + pub visible_rects: Arc, BuildHasherDefault>>, } pub struct LayoutContext<'a> { diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index 206bfe4c82d5..49875094b4fa 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -54,7 +54,7 @@ use serde_json; use std::borrow::ToOwned; use std::cell::RefCell; use std::collections::HashMap; -use std::collections::hash_state::DefaultState; +use std::hash::BuildHasherDefault; use std::ops::{Deref, DerefMut}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{channel, Sender, Receiver}; @@ -195,7 +195,7 @@ pub struct LayoutThread { /// The position and size of the visible rect for each layer. We do not build display lists /// for any areas more than `DISPLAY_PORT_SIZE_FACTOR` screens away from this area. - visible_rects: Arc, DefaultState>>, + visible_rects: Arc, BuildHasherDefault>>, /// The list of currently-running animations. running_animations: Arc>>>, @@ -430,7 +430,7 @@ impl LayoutThread { new_animations_receiver: new_animations_receiver, outstanding_web_fonts: outstanding_web_fonts_counter, root_flow: None, - visible_rects: Arc::new(HashMap::with_hash_state(Default::default())), + visible_rects: Arc::new(HashMap::with_hasher(Default::default())), running_animations: Arc::new(RwLock::new(HashMap::new())), expired_animations: Arc::new(RwLock::new(HashMap::new())), epoch: Epoch(0), @@ -1099,7 +1099,7 @@ impl LayoutThread { // layers have moved more than `DISPLAY_PORT_THRESHOLD_SIZE_FACTOR` away from their last // positions. let mut must_regenerate_display_lists = false; - let mut old_visible_rects = HashMap::with_hash_state(Default::default()); + let mut old_visible_rects = HashMap::with_hasher(Default::default()); let inflation_amount = Size2D::new(self.viewport_size.width * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR, self.viewport_size.height * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR); diff --git a/components/layout/lib.rs b/components/layout/lib.rs index cf0d2f18ea1e..4f46b0fe134e 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -6,7 +6,6 @@ #![feature(box_syntax)] #![feature(cell_extras)] #![feature(custom_derive)] -#![feature(hashmap_hasher)] #![feature(mpsc_select)] #![feature(nonzero)] #![feature(plugin)] diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index 48682ec22119..1ac0313d3c57 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -28,9 +28,9 @@ use js::rust::{AutoObjectVectorWrapper, CompileOptionsWrapper}; use libc::{c_char, size_t}; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::hash_state::DefaultState; use std::default::Default; use std::ffi::CString; +use std::hash::BuildHasherDefault; use std::rc::Rc; use std::{intrinsics, ptr}; use string_cache::Atom; @@ -161,7 +161,7 @@ pub struct EventListenerEntry { #[dom_struct] pub struct EventTarget { reflector_: Reflector, - handlers: DOMRefCell, DefaultState>>, + handlers: DOMRefCell, BuildHasherDefault>>, } impl EventTarget { diff --git a/components/script/lib.rs b/components/script/lib.rs index 6365c03c5b79..d9bdd7425597 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -12,7 +12,6 @@ #![feature(custom_attribute)] #![feature(custom_derive)] #![feature(fnbox)] -#![feature(hashmap_hasher)] #![feature(mpsc_select)] #![feature(nonzero)] #![feature(on_unimplemented)] diff --git a/components/util/cache.rs b/components/util/cache.rs index deb87405d1f0..7b8d7bfb1a06 100644 --- a/components/util/cache.rs +++ b/components/util/cache.rs @@ -6,9 +6,8 @@ use rand; use rand::Rng; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; -use std::collections::hash_state::DefaultState; use std::default::Default; -use std::hash::{Hash, Hasher, SipHasher}; +use std::hash::{BuildHasherDefault, Hash, Hasher, SipHasher}; use std::slice::Iter; @@ -17,7 +16,7 @@ pub struct HashCache where K: Clone + PartialEq + Eq + Hash, V: Clone, { - entries: HashMap>, + entries: HashMap>, } impl HashCache @@ -26,7 +25,7 @@ impl HashCache { pub fn new() -> HashCache { HashCache { - entries: HashMap::with_hash_state( as Default>::default()), + entries: HashMap::with_hasher(Default::default()), } } diff --git a/components/util/lib.rs b/components/util/lib.rs index 660945d4c1a8..01e467272384 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -8,7 +8,6 @@ #![feature(custom_derive)] #![cfg_attr(feature = "non-geckolib", feature(decode_utf16))] #![feature(fnbox)] -#![feature(hashmap_hasher)] #![feature(heap_api)] #![feature(oom)] #![feature(optin_builtin_traits)]