hax icon indicating copy to clipboard operation
hax copied to clipboard

Frontend crash: ImplExprPredNotFound on bounds on opaque types

Open W95Psp opened this issue 1 year ago • 6 comments

Reproducer:

fn uints() -> impl Iterator<Item = u64> {
    vec![0u64].into_iter()
}

fn main() {
    let mut hello = uints();
    hello.next();
}

Open this code snippet in the playground

Crashes with:

warning[E9999]: Could not find a clause for `Binder { value: <impl std::iter::Iterator<Item = u64> as std::iter::Iterator>, bound_vars: [] }` in the item parameters
 --> src/lib.rs:5:1
  |
5 | fn main() {
  | ^^^^^^^^^

Solution

We could use param_env_reveal_all_normalized, but that would tear down the opaque type abstraction.

W95Psp avatar May 22 '24 07:05 W95Psp

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Aug 28 '24 09:08 github-actions[bot]

We need to discuss that, I'm not sure this is still an bug.

W95Psp avatar Aug 28 '24 09:08 W95Psp

Ah, thanks for investigating.

W95Psp avatar Aug 29 '24 06:08 W95Psp

We could use param_env_reveal_all_normalized, but that would tear down the opaque type abstraction.

I am personally in favor of that

Nadrieril avatar Oct 02 '24 08:10 Nadrieril

Yeah, maybe that's the best thing to do, let's try it.

W95Psp avatar Oct 02 '24 08:10 W95Psp