5
5
#![ feature( btree_extract_if) ]
6
6
#![ feature( cow_is_borrowed) ]
7
7
#![ feature( core_intrinsics) ]
8
+ #![ feature( downcast_unchecked) ]
8
9
#![ feature( extract_if) ]
9
10
#![ feature( exact_size_is_empty) ]
11
+ #![ feature( hashmap_internals) ]
10
12
#![ feature( linked_list_cursors) ]
11
13
#![ feature( map_try_insert) ]
12
14
#![ feature( pattern) ]
29
31
#![ feature( const_str_from_utf8) ]
30
32
#![ feature( panic_update_hook) ]
31
33
#![ feature( pointer_is_aligned_to) ]
34
+ #![ feature( test) ]
32
35
#![ feature( thin_box) ]
33
36
#![ feature( drain_keep_rest) ]
34
37
#![ feature( local_waker) ]
38
+ #![ feature( str_as_str) ]
35
39
#![ feature( strict_provenance_lints) ]
36
40
#![ feature( vec_pop_if) ]
37
41
#![ feature( unique_rc_arc) ]
40
44
#![ deny( fuzzy_provenance_casts) ]
41
45
#![ deny( unsafe_op_in_unsafe_fn) ]
42
46
47
+ extern crate test;
48
+
43
49
use std:: hash:: { DefaultHasher , Hash , Hasher } ;
44
50
51
+ mod alloc;
45
52
mod arc;
46
53
mod autotraits;
47
54
mod borrow;
48
55
mod boxed;
49
56
mod btree_set_hash;
50
57
mod c_str;
58
+ mod c_str2;
59
+ mod collections;
51
60
mod const_fns;
52
61
mod cow_str;
53
62
mod fmt;
54
63
mod heap;
55
64
mod linked_list;
65
+ mod misc_tests;
56
66
mod rc;
57
67
mod slice;
58
68
mod sort;
59
69
mod str;
60
70
mod string;
71
+ mod sync;
61
72
mod task;
73
+ mod testing;
62
74
mod thin_box;
63
75
mod vec;
64
76
mod vec_deque;
@@ -69,6 +81,18 @@ fn hash<T: Hash>(t: &T) -> u64 {
69
81
s. finish ( )
70
82
}
71
83
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
+
72
96
// FIXME: Instantiated functions with i128 in the signature is not supported in Emscripten.
73
97
// See https://github.com/kripken/emscripten-fastcomp/issues/169
74
98
#[ cfg( not( target_os = "emscripten" ) ) ]
0 commit comments