delay cloning of iterator items
This commit is contained in:
parent
b6a23b8537
commit
62cb9d1a97
1 changed files with 18 additions and 15 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue