Skip to content

Commit 36b37e2

Browse files
committed
Remove two unnecessary clone() calls.
1 parent 2b8116d commit 36b37e2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_typeck/check/closure.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
529529
); // recreated from (*) above
530530

531531
// Check that E' = S'.
532-
let cause = &self.misc(hir_ty.span);
532+
let cause = self.misc(hir_ty.span);
533533
let InferOk {
534534
value: (),
535535
obligations,
536-
} = self.at(cause, self.param_env)
536+
} = self.at(&cause, self.param_env)
537537
.eq(*expected_ty, supplied_ty)?;
538538
all_obligations.extend(obligations);
539539

@@ -549,7 +549,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
549549
);
550550
all_obligations.push(
551551
Obligation::new(
552-
cause.clone(),
552+
cause,
553553
self.param_env,
554554
ty::Predicate::TypeOutlives(
555555
ty::Binder::dummy(

src/librustc_typeck/check/compare_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ fn compare_predicate_entailment<'tcx>(
308308

309309
let cause = ObligationCause {
310310
span: impl_err_span,
311-
..cause.clone()
311+
..cause
312312
};
313313

314314
let mut diag = struct_span_err!(tcx.sess,

0 commit comments

Comments
 (0)