Skip to content

Commit b3a0104

Browse files
authored
Rollup merge of #140047 - matthiaskrgr:clo, r=compiler-errors
remove a couple clones
2 parents 204e9a0 + de93239 commit b3a0104

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

compiler/rustc_builtin_macros/src/autodiff.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,14 @@ mod llvm_enzyme {
596596
}
597597
};
598598
let arg = ty.kind.is_simple_path().unwrap();
599-
let sl: Vec<Symbol> = vec![arg, kw::Default];
600-
let tmp = ecx.def_site_path(&sl);
599+
let tmp = ecx.def_site_path(&[arg, kw::Default]);
601600
let default_call_expr = ecx.expr_path(ecx.path(span, tmp));
602601
let default_call_expr = ecx.expr_call(new_decl_span, default_call_expr, thin_vec![]);
603602
body.stmts.push(ecx.stmt_expr(default_call_expr));
604603
return body;
605604
}
606605

607-
let mut exprs: P<ast::Expr> = primal_call.clone();
606+
let mut exprs: P<ast::Expr> = primal_call;
608607
let d_ret_ty = match d_sig.decl.output {
609608
FnRetTy::Ty(ref ty) => ty.clone(),
610609
FnRetTy::Default(span) => {
@@ -622,7 +621,7 @@ mod llvm_enzyme {
622621
// type due to the Const return activity.
623622
exprs = ecx.expr_call(new_decl_span, bb_call_expr, thin_vec![exprs]);
624623
} else {
625-
let q = QSelf { ty: d_ret_ty.clone(), path_span: span, position: 0 };
624+
let q = QSelf { ty: d_ret_ty, path_span: span, position: 0 };
626625
let y =
627626
ExprKind::Path(Some(P(q)), ecx.path_ident(span, Ident::from_str("default")));
628627
let default_call_expr = ecx.expr(span, y);
@@ -640,8 +639,7 @@ mod llvm_enzyme {
640639
let mut exprs2 = thin_vec![exprs];
641640
for arg in args.iter().skip(1) {
642641
let arg = arg.kind.is_simple_path().unwrap();
643-
let sl: Vec<Symbol> = vec![arg, kw::Default];
644-
let tmp = ecx.def_site_path(&sl);
642+
let tmp = ecx.def_site_path(&[arg, kw::Default]);
645643
let default_call_expr = ecx.expr_path(ecx.path(span, tmp));
646644
let default_call_expr =
647645
ecx.expr_call(new_decl_span, default_call_expr, thin_vec![]);

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)