Reduce verbosity when calling for
-loop on non-Iterator
expression
This commit is contained in:
parent
7227a87371
commit
75b62757e4
4 changed files with 12 additions and 7 deletions
|
@ -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),
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue