about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-26 02:07:15 +0100
committerGitHub <noreply@github.com>2020-02-26 02:07:15 +0100
commitab3fb8b05aa0c90233982fc8a8d35672d12a93a1 (patch)
tree3466177ae196953245458b14aacaf1f777e89609
parent7603c2cfba4c146aa71beb495085eaa01ff4b3d4 (diff)
parent1892ff7aa6f7d82cbe18a531da3566fbd1939e23 (diff)
downloadrust-ab3fb8b05aa0c90233982fc8a8d35672d12a93a1.tar.gz
rust-ab3fb8b05aa0c90233982fc8a8d35672d12a93a1.zip
Rollup merge of #69429 - matthiaskrgr:clippy_, r=estebank
remove redundant clones and import
-rw-r--r--src/librustc/ty/context.rs2
-rw-r--r--src/librustc/ty/mod.rs2
-rw-r--r--src/librustc/ty/query/job.rs2
-rw-r--r--src/librustc_codegen_ssa/mir/constant.rs2
-rw-r--r--src/librustc_data_structures/obligation_forest/mod.rs4
-rw-r--r--src/librustc_infer/infer/lexical_region_resolve/mod.rs2
-rw-r--r--src/librustc_macros/src/hash_stable.rs1
-rw-r--r--src/librustc_mir_build/build/expr/into.rs2
-rw-r--r--src/librustc_mir_build/build/matches/mod.rs2
9 files changed, 9 insertions, 10 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index e59738d8886..c027d6f61b0 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -1526,7 +1526,7 @@ impl<'tcx> GlobalCtxt<'tcx> {
         ty::tls::with_related_context(tcx, |icx| {
             let new_icx = ty::tls::ImplicitCtxt {
                 tcx,
-                query: icx.query.clone(),
+                query: icx.query,
                 diagnostics: icx.diagnostics,
                 layout_depth: icx.layout_depth,
                 task_deps: icx.task_deps,
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs
index a195c944ff2..d17ef3a6c9a 100644
--- a/src/librustc/ty/mod.rs
+++ b/src/librustc/ty/mod.rs
@@ -1447,7 +1447,7 @@ impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<TraitRef<'tcx>> {
 impl<'tcx> ToPredicate<'tcx> for ConstnessAnd<&TraitRef<'tcx>> {
     fn to_predicate(&self) -> Predicate<'tcx> {
         ty::Predicate::Trait(
-            ty::Binder::dummy(ty::TraitPredicate { trait_ref: self.value.clone() }),
+            ty::Binder::dummy(ty::TraitPredicate { trait_ref: *self.value }),
             self.constness,
         )
     }
diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs
index 8aae57e72cd..3394fed8402 100644
--- a/src/librustc/ty/query/job.rs
+++ b/src/librustc/ty/query/job.rs
@@ -173,7 +173,7 @@ impl<'tcx> QueryLatch<'tcx> {
                 return CycleError { usage, cycle };
             }
 
-            current_job = info.job.parent.clone();
+            current_job = info.job.parent;
         }
 
         panic!("did not find a cycle")
diff --git a/src/librustc_codegen_ssa/mir/constant.rs b/src/librustc_codegen_ssa/mir/constant.rs
index 9ceb75a603b..4248627dcca 100644
--- a/src/librustc_codegen_ssa/mir/constant.rs
+++ b/src/librustc_codegen_ssa/mir/constant.rs
@@ -31,7 +31,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
             _ => {
                 let val = self.eval_mir_constant(constant)?;
                 let ty = self.monomorphize(&constant.literal.ty);
-                Ok(OperandRef::from_const(bx, val.clone(), ty))
+                Ok(OperandRef::from_const(bx, val, ty))
             }
         }
     }
diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs
index 334daddba88..6711a49b2b7 100644
--- a/src/librustc_data_structures/obligation_forest/mod.rs
+++ b/src/librustc_data_structures/obligation_forest/mod.rs
@@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
             return Ok(());
         }
 
-        match self.active_cache.entry(obligation.as_cache_key().clone()) {
+        match self.active_cache.entry(obligation.as_cache_key()) {
             Entry::Occupied(o) => {
                 let node = &mut self.nodes[*o.get()];
                 if let Some(parent_index) = parent {
@@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
         self.error_cache
             .entry(node.obligation_tree_id)
             .or_default()
-            .insert(node.obligation.as_cache_key().clone());
+            .insert(node.obligation.as_cache_key());
     }
 
     /// Performs a pass through the obligation list. This must
diff --git a/src/librustc_infer/infer/lexical_region_resolve/mod.rs b/src/librustc_infer/infer/lexical_region_resolve/mod.rs
index 0b5536219e5..fc9f3bb0767 100644
--- a/src/librustc_infer/infer/lexical_region_resolve/mod.rs
+++ b/src/librustc_infer/infer/lexical_region_resolve/mod.rs
@@ -848,7 +848,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
         for upper_bound in &upper_bounds {
             if let ty::RePlaceholder(p) = upper_bound.region {
                 if node_universe.cannot_name(p.universe) {
-                    let origin = self.var_infos[node_idx].origin.clone();
+                    let origin = self.var_infos[node_idx].origin;
                     errors.push(RegionResolutionError::UpperBoundUniverseConflict(
                         node_idx,
                         origin,
diff --git a/src/librustc_macros/src/hash_stable.rs b/src/librustc_macros/src/hash_stable.rs
index e6f457dd663..dc6ae961e5a 100644
--- a/src/librustc_macros/src/hash_stable.rs
+++ b/src/librustc_macros/src/hash_stable.rs
@@ -1,7 +1,6 @@
 use proc_macro2::{self, Ident};
 use quote::quote;
 use syn::{self, parse_quote, Meta, NestedMeta};
-use synstructure;
 
 struct Attributes {
     ignore: bool,
diff --git a/src/librustc_mir_build/build/expr/into.rs b/src/librustc_mir_build/build/expr/into.rs
index 51b0b5bc7cb..4583e244f49 100644
--- a/src/librustc_mir_build/build/expr/into.rs
+++ b/src/librustc_mir_build/build/expr/into.rs
@@ -376,7 +376,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                     TerminatorKind::Yield {
                         value,
                         resume,
-                        resume_arg: destination.clone(),
+                        resume_arg: *destination,
                         drop: cleanup,
                     },
                 );
diff --git a/src/librustc_mir_build/build/matches/mod.rs b/src/librustc_mir_build/build/matches/mod.rs
index f900ae45b94..79951255243 100644
--- a/src/librustc_mir_build/build/matches/mod.rs
+++ b/src/librustc_mir_build/build/matches/mod.rs
@@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                 }
             }
             PatKind::Or { ref pats } => {
-                self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
+                self.visit_bindings(&pats[0], pattern_user_ty, f);
             }
         }
     }