@@ -286,7 +286,7 @@ mod llvm_enzyme {
286
286
let orig_annotatable: Annotatable = match item {
287
287
Annotatable :: Item ( ref mut iitem) => {
288
288
if !iitem. attrs . iter ( ) . any ( |a| a. id == attr. id ) {
289
- iitem. attrs . push ( attr. clone ( ) ) ;
289
+ iitem. attrs . push ( attr) ;
290
290
}
291
291
if !iitem. attrs . iter ( ) . any ( |a| a. id == inline_never. id ) {
292
292
iitem. attrs . push ( inline_never. clone ( ) ) ;
@@ -295,7 +295,7 @@ mod llvm_enzyme {
295
295
}
296
296
Annotatable :: AssocItem ( ref mut assoc_item, i @ Impl ) => {
297
297
if !assoc_item. attrs . iter ( ) . any ( |a| a. id == attr. id ) {
298
- assoc_item. attrs . push ( attr. clone ( ) ) ;
298
+ assoc_item. attrs . push ( attr) ;
299
299
}
300
300
if !assoc_item. attrs . iter ( ) . any ( |a| a. id == inline_never. id ) {
301
301
assoc_item. attrs . push ( inline_never. clone ( ) ) ;
@@ -322,7 +322,7 @@ mod llvm_enzyme {
322
322
let d_annotatable = if is_impl {
323
323
let assoc_item: AssocItemKind = ast:: AssocItemKind :: Fn ( asdf) ;
324
324
let d_fn = P ( ast:: AssocItem {
325
- attrs : thin_vec ! [ d_attr. clone ( ) , inline_never] ,
325
+ attrs : thin_vec ! [ d_attr, inline_never] ,
326
326
id : ast:: DUMMY_NODE_ID ,
327
327
span,
328
328
vis,
@@ -332,12 +332,8 @@ mod llvm_enzyme {
332
332
} ) ;
333
333
Annotatable :: AssocItem ( d_fn, Impl )
334
334
} else {
335
- let mut d_fn = ecx. item (
336
- span,
337
- d_ident,
338
- thin_vec ! [ d_attr. clone( ) , inline_never] ,
339
- ItemKind :: Fn ( asdf) ,
340
- ) ;
335
+ let mut d_fn =
336
+ ecx. item ( span, d_ident, thin_vec ! [ d_attr, inline_never] , ItemKind :: Fn ( asdf) ) ;
341
337
d_fn. vis = vis;
342
338
Annotatable :: Item ( d_fn)
343
339
} ;
@@ -446,7 +442,7 @@ mod llvm_enzyme {
446
442
447
443
if primal_ret && n_active == 0 && x. mode . is_rev ( ) {
448
444
// We only have the primal ret.
449
- body. stmts . push ( ecx. stmt_expr ( black_box_primal_call. clone ( ) ) ) ;
445
+ body. stmts . push ( ecx. stmt_expr ( black_box_primal_call) ) ;
450
446
return body;
451
447
}
452
448
@@ -471,7 +467,7 @@ mod llvm_enzyme {
471
467
if primal_ret {
472
468
// We have both primal ret and active floats.
473
469
// primal ret is first, by construction.
474
- exprs. push ( primal_call. clone ( ) ) ;
470
+ exprs. push ( primal_call) ;
475
471
}
476
472
477
473
// Now construct default placeholder for each active float.
@@ -538,16 +534,11 @@ mod llvm_enzyme {
538
534
return body;
539
535
}
540
536
[ arg] => {
541
- ret = ecx. expr_call (
542
- new_decl_span,
543
- blackbox_call_expr. clone ( ) ,
544
- thin_vec ! [ arg. clone( ) ] ,
545
- ) ;
537
+ ret = ecx. expr_call ( new_decl_span, blackbox_call_expr, thin_vec ! [ arg. clone( ) ] ) ;
546
538
}
547
539
args => {
548
540
let ret_tuple: P < ast:: Expr > = ecx. expr_tuple ( span, args. into ( ) ) ;
549
- ret =
550
- ecx. expr_call ( new_decl_span, blackbox_call_expr. clone ( ) , thin_vec ! [ ret_tuple] ) ;
541
+ ret = ecx. expr_call ( new_decl_span, blackbox_call_expr, thin_vec ! [ ret_tuple] ) ;
551
542
}
552
543
}
553
544
assert ! ( has_ret( & d_sig. decl. output) ) ;
@@ -567,7 +558,7 @@ mod llvm_enzyme {
567
558
let args: ThinVec < _ > =
568
559
idents[ 1 ..] . iter ( ) . map ( |arg| ecx. expr_path ( ecx. path_ident ( span, * arg) ) ) . collect ( ) ;
569
560
let self_expr = ecx. expr_self ( span) ;
570
- ecx. expr_method_call ( span, self_expr, primal, args. clone ( ) )
561
+ ecx. expr_method_call ( span, self_expr, primal, args)
571
562
} else {
572
563
let args: ThinVec < _ > =
573
564
idents. iter ( ) . map ( |arg| ecx. expr_path ( ecx. path_ident ( span, * arg) ) ) . collect ( ) ;
0 commit comments