55#![ feature( btree_extract_if) ]
66#![ feature( cow_is_borrowed) ]
77#![ feature( core_intrinsics) ]
8+ #![ feature( downcast_unchecked) ]
89#![ feature( extract_if) ]
910#![ feature( exact_size_is_empty) ]
11+ #![ feature( hashmap_internals) ]
1012#![ feature( linked_list_cursors) ]
1113#![ feature( map_try_insert) ]
1214#![ feature( pattern) ]
2931#![ feature( const_str_from_utf8) ]
3032#![ feature( panic_update_hook) ]
3133#![ feature( pointer_is_aligned_to) ]
34+ #![ feature( test) ]
3235#![ feature( thin_box) ]
3336#![ feature( drain_keep_rest) ]
3437#![ feature( local_waker) ]
38+ #![ feature( str_as_str) ]
3539#![ feature( strict_provenance_lints) ]
3640#![ feature( vec_pop_if) ]
3741#![ feature( unique_rc_arc) ]
4044#![ deny( fuzzy_provenance_casts) ]
4145#![ deny( unsafe_op_in_unsafe_fn) ]
4246
47+ extern crate test;
48+
4349use std:: hash:: { DefaultHasher , Hash , Hasher } ;
4450
51+ mod alloc;
4552mod arc;
4653mod autotraits;
4754mod borrow;
4855mod boxed;
4956mod btree_set_hash;
5057mod c_str;
58+ mod c_str2;
59+ mod collections;
5160mod const_fns;
5261mod cow_str;
5362mod fmt;
5463mod heap;
5564mod linked_list;
65+ mod misc_tests;
5666mod rc;
5767mod slice;
5868mod sort;
5969mod str;
6070mod string;
71+ mod sync;
6172mod task;
73+ mod testing;
6274mod thin_box;
6375mod vec;
6476mod vec_deque;
@@ -69,6 +81,18 @@ fn hash<T: Hash>(t: &T) -> u64 {
6981 s. finish ( )
7082}
7183
84+ /// Copied from `std::test_helpers::test_rng`, since these tests rely on the
85+ /// seed not being the same for every RNG invocation too.
86+ fn test_rng ( ) -> rand_xorshift:: XorShiftRng {
87+ use std:: hash:: { BuildHasher , Hash , Hasher } ;
88+ let mut hasher = std:: hash:: RandomState :: new ( ) . build_hasher ( ) ;
89+ std:: panic:: Location :: caller ( ) . hash ( & mut hasher) ;
90+ let hc64 = hasher. finish ( ) ;
91+ let seed_vec = hc64. to_le_bytes ( ) . into_iter ( ) . chain ( 0u8 ..8 ) . collect :: < Vec < u8 > > ( ) ;
92+ let seed: [ u8 ; 16 ] = seed_vec. as_slice ( ) . try_into ( ) . unwrap ( ) ;
93+ rand:: SeedableRng :: from_seed ( seed)
94+ }
95+
7296// FIXME: Instantiated functions with i128 in the signature is not supported in Emscripten.
7397// See https://github.com/kripken/emscripten-fastcomp/issues/169
7498#[ cfg( not( target_os = "emscripten" ) ) ]
0 commit comments