File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -753,11 +753,13 @@ impl TraceDeriveInput {
753753 let traced_field_types = self . determine_field_types ( false ) ;
754754 let all_field_types = self . determine_field_types ( true ) ;
755755 let needs_trace = traced_field_types. iter ( ) . map ( |ty| quote_spanned ! ( ty. span( ) => <#ty as zerogc:: Trace >:: NEEDS_TRACE ) ) ;
756- let needs_drop = all_field_types. iter ( ) . map ( |ty| if traced_field_types. contains ( ty) {
756+ let needs_drop = if self . is_copy {
757+ quote ! ( false )
758+ } else if all_field_types. iter ( ) . map ( |ty| if traced_field_types. contains ( ty) ) {
757759 quote_spanned ! ( ty. span( ) => <#ty as zerogc:: Trace >:: NEEDS_DROP )
758760 } else {
759761 quote_spanned ! ( ty. span( ) => core:: mem:: needs_drop:: <#ty>( ) )
760- } ) ;
762+ } ;
761763 let assoc_constants = if !immutable {
762764 Some ( quote ! {
763765 const NEEDS_TRACE : bool = #( #needs_trace || ) * false /* NOTE: Default to *false* if we have no GC types inside */ ;
You can’t perform that action at this time.
0 commit comments