Description
While playing around with the scenario mentioned in https://users.rust-lang.org/t/intoiterator-and-lifetimes/11574, I hit an ICE with the following message:
error: internal compiler error: /checkout/src/librustc/infer/mod.rs:573: Encountered errors
[FulfillmentError(Obligation(predicate=Binder(TraitPredicate(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(Record<'_>,)>>)),depth=0),OutputTypeParameterMismatch(Binder(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(<&DataSet as std::iter::IntoIterator>::Item,)>>), Binder(<[closure@<anon>:70:23: 70:29] as std::ops::FnOnce<(Record<'_>,)>>), Sorts(ExpectedFound { expected: Record<'_>, found: <&DataSet as std::iter::IntoIterator>::Item })))]
resolving bounds after type-checkingnote: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.20.0-nightly (f590a44 2017-06-27) running on x86_64-unknown-linux-gnu
thread 'rustc' panicked at 'Box', /checkout/src/librustc_errors/lib.rs:426
note: Run withRUST_BACKTRACE=1
for a backtrace.
This also happens on the current stable (rustc 1.18.0 (03fc9d6 2017-06-06)) channel as well. Here's a repro on the playground.