1
Fork 0

Reduce verbosity when calling for-loop on non-Iterator expression

This commit is contained in:
Esteban Kuber 2021-11-16 01:46:28 +00:00
parent 7227a87371
commit 75b62757e4
4 changed files with 12 additions and 7 deletions

View file

@ -810,8 +810,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&substs,
match lang_item {
hir::LangItem::FuturePoll => ObligationCauseCode::AwaitableExpr,
// FIXME: see if there are other obligation specializations we could do here beyond
// what we do above for `.await`.
hir::LangItem::IntoIterIntoIter => ObligationCauseCode::ForLoopIterator,
// FIXME: This could also be used for `?`. See if there are others.
_ => traits::ItemObligation(def_id),
},
);