]> git.lizzy.rs Git - rust.git/commitdiff
Remove two unnecessary `clone()` calls.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 8 Sep 2019 22:25:54 +0000 (08:25 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Sun, 8 Sep 2019 23:43:23 +0000 (09:43 +1000)
src/librustc_typeck/check/closure.rs
src/librustc_typeck/check/compare_method.rs

index e9370429f3f55af945ce61df84dbe81854068ec4..d626bff15002049ae9e7433effcc254cd9174dbf 100644 (file)
@@ -529,11 +529,11 @@ fn check_supplied_sig_against_expectation(
                 ); // recreated from (*) above
 
                 // Check that E' = S'.
-                let cause = &self.misc(hir_ty.span);
+                let cause = self.misc(hir_ty.span);
                 let InferOk {
                     value: (),
                     obligations,
-                } = self.at(cause, self.param_env)
+                } = self.at(&cause, self.param_env)
                     .eq(*expected_ty, supplied_ty)?;
                 all_obligations.extend(obligations);
 
@@ -549,7 +549,7 @@ fn check_supplied_sig_against_expectation(
                 );
                 all_obligations.push(
                     Obligation::new(
-                        cause.clone(),
+                        cause,
                         self.param_env,
                         ty::Predicate::TypeOutlives(
                             ty::Binder::dummy(
index 8e187b7e05b51ab0e10a0b7729be4ce1b947cd57..74ea93fc442707adec2d5c0e9d1afbef166f4a10 100644 (file)
@@ -308,7 +308,7 @@ fn compare_predicate_entailment<'tcx>(
 
             let cause = ObligationCause {
                 span: impl_err_span,
-                ..cause.clone()
+                ..cause
             };
 
             let mut diag = struct_span_err!(tcx.sess,