@@ -16,6 +16,7 @@ use crate::{
1616} ;
1717
1818#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , TypeLayout ) ]
19+ #[ cfg_attr( feature = "cuda" , derive( rust_cuda:: lend:: LendRustToCuda ) ) ]
1920#[ repr( transparent) ]
2021pub struct GlobalLineageReference ( u64 ) ;
2122
@@ -94,23 +95,30 @@ impl From<Option<GlobalLineageReference>> for LineageInteraction {
9495 }
9596}
9697
97- #[ allow( clippy:: unsafe_derive_deserialize) ]
98+ #[ allow( clippy:: unsafe_derive_deserialize, clippy :: module_name_repetitions ) ]
9899#[ derive( Debug , Clone , PartialEq , Eq , Hash , Serialize , Deserialize , TypeLayout ) ]
99- #[ serde ( deny_unknown_fields ) ]
100+ #[ cfg_attr ( feature = "cuda" , derive ( rust_cuda :: lend :: LendRustToCuda ) ) ]
100101#[ repr( C ) ]
102+ #[ cuda( ignore) ]
103+ #[ serde( deny_unknown_fields) ]
101104pub struct Lineage {
105+ #[ cuda( embed) ]
106+ #[ cuda( ignore) ]
102107 #[ serde( alias = "id" , alias = "ref" ) ]
103108 pub global_reference : GlobalLineageReference ,
109+ #[ cuda( ignore) ]
104110 #[ serde( alias = "time" ) ]
105111 pub last_event_time : NonNegativeF64 ,
112+ #[ cuda( ignore) ]
106113 #[ serde( alias = "loc" ) ]
107114 pub indexed_location : IndexedLocation ,
108115}
109116
110117impl Lineage {
111118 #[ must_use]
119+ #[ allow( clippy:: no_effect_underscore_binding) ]
112120 #[ debug_ensures(
113- ret. indexed_location == old( indexed_location. clone ( ) ) ,
121+ ret. indexed_location == old( indexed_location) ,
114122 "stores the indexed_location"
115123 ) ]
116124 #[ debug_ensures( ret. last_event_time == 0.0_f64 , "starts at t_0 = 0.0" ) ]
@@ -178,8 +186,8 @@ impl Backup for MigratingLineage {
178186 unsafe fn backup_unchecked ( & self ) -> Self {
179187 Self {
180188 global_reference : self . global_reference . backup_unchecked ( ) ,
181- dispersal_origin : self . dispersal_origin . clone ( ) ,
182- dispersal_target : self . dispersal_target . clone ( ) ,
189+ dispersal_origin : self . dispersal_origin ,
190+ dispersal_target : self . dispersal_target ,
183191 prior_time : self . prior_time ,
184192 event_time : self . event_time ,
185193 coalescence_rng_sample : self . coalescence_rng_sample . backup_unchecked ( ) ,
0 commit comments