Skip to content

Commit ee7017d

Browse files
committed
remove a couple clones
1 parent a7c39b6 commit ee7017d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_builtin_macros/src/autodiff.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ mod llvm_enzyme {
604604
return body;
605605
}
606606

607-
let mut exprs: P<ast::Expr> = primal_call.clone();
607+
let mut exprs: P<ast::Expr> = primal_call;
608608
let d_ret_ty = match d_sig.decl.output {
609609
FnRetTy::Ty(ref ty) => ty.clone(),
610610
FnRetTy::Default(span) => {
@@ -622,7 +622,7 @@ mod llvm_enzyme {
622622
// type due to the Const return activity.
623623
exprs = ecx.expr_call(new_decl_span, bb_call_expr, thin_vec![exprs]);
624624
} else {
625-
let q = QSelf { ty: d_ret_ty.clone(), path_span: span, position: 0 };
625+
let q = QSelf { ty: d_ret_ty, path_span: span, position: 0 };
626626
let y =
627627
ExprKind::Path(Some(P(q)), ecx.path_ident(span, Ident::from_str("default")));
628628
let default_call_expr = ecx.expr(span, y);

compiler/rustc_mir_build/src/builder/scope.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ fn build_scope_drops<'tcx>(
15301530
// path, then don't generate the drop. (We only take this into
15311531
// account for non-unwind paths so as not to disturb the
15321532
// caching mechanism.)
1533-
if scope.moved_locals.iter().any(|&o| o == local) {
1533+
if scope.moved_locals.contains(&local) {
15341534
continue;
15351535
}
15361536

0 commit comments

Comments
 (0)