Skip to content

Commit e8a3384

Browse files
committedSep 27, 2023
don't clone copy types
1 parent fd95627 commit e8a3384

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎compiler/rustc_hir_analysis/src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ fn impl_trait_ref(
13741374
// make astconv happy.
13751375
let mut path_segments = ast_trait_ref.path.segments.to_vec();
13761376
let last_segment = path_segments.len() - 1;
1377-
let mut args = path_segments[last_segment].args().clone();
1377+
let mut args = *path_segments[last_segment].args();
13781378
let last_arg = args.args.len() - 1;
13791379
assert!(matches!(args.args[last_arg], hir::GenericArg::Const(anon_const) if tcx.has_attr(anon_const.value.def_id, sym::rustc_host)));
13801380
args.args = &args.args[..args.args.len() - 1];

‎compiler/stable_mir/src/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Foldable for UnevaluatedConst {
8181

8282
impl Foldable for ConstDef {
8383
fn super_fold<V: Folder>(&self, _folder: &mut V) -> ControlFlow<V::Break, Self> {
84-
ControlFlow::Continue(self.clone())
84+
ControlFlow::Continue(*self)
8585
}
8686
}
8787

@@ -96,7 +96,7 @@ impl<T: Foldable> Foldable for Option<T> {
9696

9797
impl Foldable for Promoted {
9898
fn super_fold<V: Folder>(&self, _folder: &mut V) -> ControlFlow<V::Break, Self> {
99-
ControlFlow::Continue(self.clone())
99+
ControlFlow::Continue(*self)
100100
}
101101
}
102102

0 commit comments

Comments
 (0)
Please sign in to comment.