1
- use crate :: assert_size;
2
- use std:: any:: Any ;
3
1
use std:: marker:: PhantomData ;
4
2
use std:: slice;
5
3
@@ -12,7 +10,6 @@ pub struct Array<T> {
12
10
pub capacity : u32 ,
13
11
pub entries : * mut T ,
14
12
}
15
- // assert_size!(Array<dyn Any>, 16);
16
13
17
14
impl < T > Array < T > {
18
15
pub fn slice ( & self ) -> & [ T ] {
@@ -29,14 +26,13 @@ impl<T> Array<T> {
29
26
pub struct Ref < T > {
30
27
pub ptr : * mut T ,
31
28
}
32
- // assert_size!(Ref<dyn Any>, 8);
33
29
34
30
#[ derive( Debug , Clone ) ]
35
31
#[ repr( C ) ]
36
32
pub struct StreamingRef < T > {
37
33
pub ptr : * mut T ,
38
34
}
39
- // assert_size!(StreamingRef<dyn Any>, 8);
35
+
40
36
41
37
#[ derive( Debug , Clone ) ]
42
38
#[ repr( C ) ]
@@ -45,7 +41,6 @@ pub struct UUIDRef<T> {
45
41
pub uuid : [ u8 ; 16 ] ,
46
42
pub marker : PhantomData < T > ,
47
43
}
48
- // assert_size!(UUIDRef<dyn Any>, 16);
49
44
50
45
// todo: reverse WeakPtr
51
46
#[ derive( Debug , Clone ) ]
@@ -54,11 +49,9 @@ pub struct WeakPtr<T> {
54
49
pub unk : [ u8 ; 32 ] ,
55
50
pub marker : PhantomData < T > ,
56
51
}
57
- // assert_size!(WeakPtr<dyn Any>, 32);
58
52
59
53
#[ allow( non_camel_case_types) ]
60
54
pub type cptr < T > = Ref < T > ;
61
- // assert_size!(cptr<dyn Any>, 8);
62
55
63
56
#[ derive( Debug , Clone ) ]
64
57
#[ repr( C ) ]
@@ -69,10 +62,8 @@ pub struct HashMapEntry<V> {
69
62
70
63
#[ derive( Debug , Clone ) ]
71
64
#[ repr( C ) ]
72
- pub struct HashMap < K , V > {
73
- pub entries : * mut HashMapEntry < V > ,
65
+ pub struct HashMap < T > {
66
+ pub entries : * mut HashMapEntry < T > ,
74
67
pub size : u32 ,
75
68
pub capacity : u32 ,
76
-
77
- pub key_marker : PhantomData < K > ,
78
69
}
0 commit comments