summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-09-11 10:18:56 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2021-09-11 10:18:56 +0200
commitc1e96085d36af614ac9bb1c36dde9a5706eef6ec (patch)
treee7d6ffbd044166109bab8167a329bd51094c280c /compiler/rustc_mir_transform/src
parent22719efcc570b043f2e519d6025e5f36eab38fe2 (diff)
downloadrust-c1e96085d36af614ac9bb1c36dde9a5706eef6ec.tar.gz
rust-c1e96085d36af614ac9bb1c36dde9a5706eef6ec.zip
don't clone types that are Copy (clippy::clone_on_copy)
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/lower_slice_len.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/lower_slice_len.rs b/compiler/rustc_mir_transform/src/lower_slice_len.rs
index 30de374a2d8..a2cce9f1eda 100644
--- a/compiler/rustc_mir_transform/src/lower_slice_len.rs
+++ b/compiler/rustc_mir_transform/src/lower_slice_len.rs
@@ -75,13 +75,11 @@ fn lower_slice_len_call<'tcx>(
                     let deref_arg = tcx.mk_place_deref(arg);
                     let r_value = Rvalue::Len(deref_arg);
                     let len_statement_kind = StatementKind::Assign(Box::new((*dest, r_value)));
-                    let add_statement = Statement {
-                        kind: len_statement_kind,
-                        source_info: terminator.source_info.clone(),
-                    };
+                    let add_statement =
+                        Statement { kind: len_statement_kind, source_info: terminator.source_info };
 
                     // modify terminator into simple Goto
-                    let new_terminator_kind = TerminatorKind::Goto { target: bb.clone() };
+                    let new_terminator_kind = TerminatorKind::Goto { target: *bb };
 
                     let patch = SliceLenPatchInformation { add_statement, new_terminator_kind };