@@ -6,9 +6,9 @@ use zerogc_derive::unsafe_gc_impl;
6
6
7
7
unsafe_gc_impl ! {
8
8
target => IndexMap <K , V , S >,
9
- params => [ K : TraceImmutable , V , S : ' static ] ,
9
+ params => [ K , V , S : ' static ] ,
10
10
bounds => {
11
- Trace => { where K : TraceImmutable , V : Trace , S : ' static } ,
11
+ Trace => { where K : Trace , V : Trace , S : ' static } ,
12
12
TraceImmutable => { where K : TraceImmutable , V : TraceImmutable , S : ' static } ,
13
13
TrustedDrop => { where K : TrustedDrop , V : TrustedDrop , S : ' static } ,
14
14
GcSafe => { where K : GcSafe <' gc, Id >, V : GcSafe <' gc, Id >, S : ' static } ,
@@ -17,10 +17,19 @@ unsafe_gc_impl! {
17
17
NEEDS_TRACE => K :: NEEDS_TRACE || V :: NEEDS_TRACE ,
18
18
NEEDS_DROP => true , // Internal memory
19
19
collector_id => * ,
20
- visit => |self , visitor| {
21
- for ( key, value) in self . #iter( ) {
20
+ trace_mut => |self , visitor| {
21
+ for idx in 0 ..self . len( ) {
22
+ let ( key, value) = self . get_index_mut( idx) . unwrap( ) ;
23
+ visitor. visit:: <K >( key) ?;
24
+ visitor. visit:: <V >( value) ?;
25
+ }
26
+ // NOTE: S: 'static implies S: NullTrace
27
+ Ok ( ( ) )
28
+ } ,
29
+ trace_immutable => |self , visitor| {
30
+ for ( key, value) in self . iter( ) {
22
31
visitor. visit_immutable:: <K >( key) ?;
23
- visitor. #visit_func :: <V >( value) ?;
32
+ visitor. visit_immutable :: <V >( value) ?;
24
33
}
25
34
// NOTE: S: 'static implies S: NullTrace
26
35
Ok ( ( ) )
0 commit comments