1
Fork 0

delay cloning of iterator items

This commit is contained in:
Matthias Krüger 2024-02-23 19:07:42 +01:00
parent b6a23b8537
commit 62cb9d1a97

View file

@ -320,7 +320,9 @@ fn impl_intersection_has_impossible_obligation<'a, 'cx, 'tcx>(
let mut errors = fulfill_cx.select_where_possible(infcx);
errors.pop().map(|err| err.obligation)
} else {
obligations.iter().cloned().find(|obligation| {
obligations
.iter()
.find(|obligation| {
// We use `evaluate_root_obligation` to correctly track intercrate
// ambiguity clauses. We cannot use this in the new solver.
let evaluation_result = selcx.evaluate_root_obligation(obligation);
@ -336,6 +338,7 @@ fn impl_intersection_has_impossible_obligation<'a, 'cx, 'tcx>(
Err(_overflow) => false,
}
})
.cloned()
}
}