Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coherence rule changes in latest nightly break parser-combinators #27

Closed
hugoduncan opened this issue Apr 2, 2015 · 3 comments
Closed

Comments

@hugoduncan
Copy link
Contributor

The impls for Stream for &str and &[T] now conflict with that for I: Iterator + Clone.

This is due to the changes in rust-lang/rust#23867, in particular the negative reasoning as demonstrated in the Replacer example.

The problem in this case, iiuc, is that &str and &[T] could one day decide to implement Iterator.

@hawkw
Copy link
Contributor

hawkw commented Apr 3, 2015

👍

Marwes referenced this issue Apr 3, 2015
@Marwes
Copy link
Owner

Marwes commented Apr 3, 2015

That's an annoying breaking change. Guess the Iterator impl needs to be wrapped in a newtype though it is quite an unergonomic workaround. Still, it feels better than to remove the &str and &[T] impls since parsing a string directly is so common.

@Marwes
Copy link
Owner

Marwes commented Apr 3, 2015

Fixed in c3c54a8 and pushed to cargo with 6398c2e (0.2.6).

I am not sure that these changes are the ideal choice though, might be that the Stream trait is better of being only implemented for Iterator, essentially making it an Iterator with a Clone bound

@Marwes Marwes closed this as completed Apr 3, 2015
hawkw added a commit to hawkw/seax that referenced this issue Apr 3, 2015
Fixes the build with latest Rust nightly. See
Marwes/combine#26 and Marwes/combine#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants