File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -753,11 +753,13 @@ impl TraceDeriveInput {
753
753
let traced_field_types = self . determine_field_types ( false ) ;
754
754
let all_field_types = self . determine_field_types ( true ) ;
755
755
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) ) {
757
759
quote_spanned ! ( ty. span( ) => <#ty as zerogc:: Trace >:: NEEDS_DROP )
758
760
} else {
759
761
quote_spanned ! ( ty. span( ) => core:: mem:: needs_drop:: <#ty>( ) )
760
- } ) ;
762
+ } ;
761
763
let assoc_constants = if !immutable {
762
764
Some ( quote ! {
763
765
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