diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-01 18:52:22 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-09 20:11:33 +0100 |
| commit | 8edd32c9404f416945d82c438a62acb7f90c2f62 (patch) | |
| tree | 91b37ae62fd7879872bec063963db00c105bac90 | |
| parent | e1a72c29aaef3b3145296dfc9e24201b3c655768 (diff) | |
| download | rust-8edd32c9404f416945d82c438a62acb7f90c2f62.tar.gz rust-8edd32c9404f416945d82c438a62acb7f90c2f62.zip | |
Avoid clone.
| -rw-r--r-- | compiler/rustc_traits/src/dropck_outlives.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_traits/src/dropck_outlives.rs b/compiler/rustc_traits/src/dropck_outlives.rs index 147d99ff1dd..087c216af14 100644 --- a/compiler/rustc_traits/src/dropck_outlives.rs +++ b/compiler/rustc_traits/src/dropck_outlives.rs @@ -275,12 +275,12 @@ fn dtorck_constraint_for_ty<'tcx>( ty::Adt(def, substs) => { let DtorckConstraint { dtorck_types, outlives, overflows } = - tcx.at(span).adt_dtorck_constraint(def.did)?.clone(); + tcx.at(span).adt_dtorck_constraint(def.did)?; // FIXME: we can try to recursively `dtorck_constraint_on_ty` // there, but that needs some way to handle cycles. - constraints.dtorck_types.extend(dtorck_types.subst(tcx, substs)); - constraints.outlives.extend(outlives.subst(tcx, substs)); - constraints.overflows.extend(overflows.subst(tcx, substs)); + constraints.dtorck_types.extend(dtorck_types.iter().map(|t| t.subst(tcx, substs))); + constraints.outlives.extend(outlives.iter().map(|t| t.subst(tcx, substs))); + constraints.overflows.extend(overflows.iter().map(|t| t.subst(tcx, substs))); } // Objects must be alive in order for their destructor |
