Hacker News new | ask | show | jobs
by jamii 4028 days ago
Oh... well that's embarrassing.

So, I half-remembered the actual problem I ran into and found something that half-looked like it mentioned it. Not my finest hour :S

I dug up the IRC exchange for the problem I actually ran into:

    jamii
    How do I write the type of a byte iterator:
    fn next_path<N: Iterator>(nibbles: &mut N) -> u32 where <N as Iterator>::Item = u8 {
    That gives me 'equality constraints are not yet supported'
    FreeFull
    jamii: <N: Iterator<Item = u8>>
Equality constraints seem to still be unimplemented ( https://github.com/rust-lang/rust/pull/22074) but I can write this instead

    where N : Iterator<Item=u8>
So that whole section of the post is incorrect. I've removed it and linked to this discussion instead.
1 comments

I'm the author of the above pull request (as well as other pieces of where clauses), unfortunately there are some internals that need refactoring before we can complete equality constraints, and they weren't the highest priority before 1.0 especially since you can encode a trait that acts in the same way. I'm starting at Mozilla for the summer next week and hope to fix a couple of the outstanding issues around them and associated types.