66use crate :: object:: { Cast , IsClass , IsInterface , ObjectSubclassIs , ObjectType , ParentClassIs } ;
77use crate :: translate:: * ;
88use crate :: { Closure , Object , StaticType , Type , Value } ;
9- use rustc_hash:: FxHashMap as HashMap ;
109use std:: any:: Any ;
10+ use std:: collections:: BTreeMap ;
1111use std:: marker;
1212use std:: mem;
1313use std:: ptr;
@@ -33,7 +33,7 @@ impl<T> IntoGlib for InitializingType<T> {
3333/// Struct used for the instance private data of the GObject.
3434struct PrivateStruct < T : ObjectSubclass > {
3535 imp : T ,
36- instance_data : Option < HashMap < Type , Box < dyn Any + Send + Sync > > > ,
36+ instance_data : Option < BTreeMap < Type , Box < dyn Any + Send + Sync > > > ,
3737}
3838
3939// rustdoc-stripper-ignore-next
@@ -245,7 +245,7 @@ unsafe extern "C" fn interface_init<T: ObjectSubclass, A: IsImplementable<T>>(
245245
246246 let mut data = T :: type_data ( ) ;
247247 if data. as_ref ( ) . parent_ifaces . is_none ( ) {
248- data. as_mut ( ) . parent_ifaces = Some ( HashMap :: default ( ) ) ;
248+ data. as_mut ( ) . parent_ifaces = Some ( BTreeMap :: default ( ) ) ;
249249 }
250250 {
251251 let copy = Box :: new ( * iface. as_ref ( ) ) ;
@@ -360,9 +360,9 @@ pub struct TypeData {
360360 #[ doc( hidden) ]
361361 pub parent_class : ffi:: gpointer ,
362362 #[ doc( hidden) ]
363- pub parent_ifaces : Option < HashMap < Type , ffi:: gpointer > > ,
363+ pub parent_ifaces : Option < BTreeMap < Type , ffi:: gpointer > > ,
364364 #[ doc( hidden) ]
365- pub class_data : Option < HashMap < Type , Box < dyn Any + Send + Sync > > > ,
365+ pub class_data : Option < BTreeMap < Type , Box < dyn Any + Send + Sync > > > ,
366366 #[ doc( hidden) ]
367367 pub private_offset : isize ,
368368 #[ doc( hidden) ]
@@ -452,7 +452,7 @@ impl TypeData {
452452 /// If the class_data already contains a data for the specified `type_`.
453453 pub unsafe fn set_class_data < T : Any + Send + Sync + ' static > ( & mut self , type_ : Type , data : T ) {
454454 if self . class_data . is_none ( ) {
455- self . class_data = Some ( HashMap :: default ( ) ) ;
455+ self . class_data = Some ( BTreeMap :: default ( ) ) ;
456456 }
457457
458458 if let Some ( ref mut class_data) = self . class_data {
@@ -763,7 +763,7 @@ impl<T: ObjectSubclass> InitializingObject<T> {
763763 let priv_ = & mut * ptr;
764764
765765 if priv_. instance_data . is_none ( ) {
766- priv_. instance_data = Some ( HashMap :: default ( ) ) ;
766+ priv_. instance_data = Some ( BTreeMap :: default ( ) ) ;
767767 }
768768
769769 if let Some ( ref mut instance_data) = priv_. instance_data {
0 commit comments