about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-01-15 15:00:25 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-01-15 15:00:25 +0100
commit312c3a067a090dd7c970ba40c08909ca1281c312 (patch)
tree3e9ba5e1a9a0b9cd8a70be89b6d2431d8d93048f
parentc74353c7d2e61b111a9241490b9fbbd1ebe491fe (diff)
downloadrust-312c3a067a090dd7c970ba40c08909ca1281c312.tar.gz
rust-312c3a067a090dd7c970ba40c08909ca1281c312.zip
remove redundant clones, found by clippy
-rw-r--r--src/librustc_driver/pretty.rs2
-rw-r--r--src/librustc_parse/parser/ty.rs2
-rw-r--r--src/librustc_resolve/imports.rs2
-rw-r--r--src/librustdoc/test.rs2
-rw-r--r--src/libtest/lib.rs4
5 files changed, 5 insertions, 7 deletions
diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs
index 8804a05b596..6ef6dcf87ed 100644
--- a/src/librustc_driver/pretty.rs
+++ b/src/librustc_driver/pretty.rs
@@ -429,7 +429,6 @@ pub fn print_after_hir_lowering<'tcx>(
         PpmSource(s) => {
             // Silently ignores an identified node.
             let out = &mut out;
-            let src = src.clone();
             call_with_pp_support(&s, tcx.sess, Some(tcx), move |annotation| {
                 debug!("pretty printing source code {:?}", s);
                 let sess = annotation.sess();
@@ -447,7 +446,6 @@ pub fn print_after_hir_lowering<'tcx>(
 
         PpmHir(s) => {
             let out = &mut out;
-            let src = src.clone();
             call_with_pp_support_hir(&s, tcx, move |annotation, krate| {
                 debug!("pretty printing source code {:?}", s);
                 let sess = annotation.sess();
diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs
index ea14aa278ac..065a3b14428 100644
--- a/src/librustc_parse/parser/ty.rs
+++ b/src/librustc_parse/parser/ty.rs
@@ -500,7 +500,7 @@ impl<'a> Parser<'a> {
             err.span_suggestion_short(
                 lo.to(self.prev_span),
                 "remove the parentheses",
-                snippet.to_owned(),
+                snippet,
                 Applicability::MachineApplicable,
             );
         }
diff --git a/src/librustc_resolve/imports.rs b/src/librustc_resolve/imports.rs
index 8fe17e89444..5bd10303162 100644
--- a/src/librustc_resolve/imports.rs
+++ b/src/librustc_resolve/imports.rs
@@ -718,7 +718,7 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
         }
 
         if !errors.is_empty() {
-            self.throw_unresolved_import_error(errors.clone(), None);
+            self.throw_unresolved_import_error(errors, None);
         }
     }
 
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs
index b5731ff0fec..f899e722a56 100644
--- a/src/librustdoc/test.rs
+++ b/src/librustdoc/test.rs
@@ -704,7 +704,7 @@ impl Tester for Collector {
         debug!("creating test {}: {}", name, test);
         self.tests.push(testing::TestDescAndFn {
             desc: testing::TestDesc {
-                name: testing::DynTestName(name.clone()),
+                name: testing::DynTestName(name),
                 ignore: match config.ignore {
                     Ignore::All => true,
                     Ignore::None => false,
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 884db85efe0..45669d120c7 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -553,7 +553,7 @@ fn run_test_in_process(
         Err(e) => calc_result(&desc, Err(e.as_ref()), &time_opts, &exec_time),
     };
     let stdout = data.lock().unwrap().to_vec();
-    let message = CompletedTest::new(desc.clone(), test_result, exec_time, stdout);
+    let message = CompletedTest::new(desc, test_result, exec_time, stdout);
     monitor_ch.send(message).unwrap();
 }
 
@@ -602,7 +602,7 @@ fn spawn_test_subprocess(
         (result, test_output, exec_time)
     })();
 
-    let message = CompletedTest::new(desc.clone(), result, exec_time, test_output);
+    let message = CompletedTest::new(desc, result, exec_time, test_output);
     monitor_ch.send(message).unwrap();
 }