-
Notifications
You must be signed in to change notification settings - Fork 807
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
"verbose-errors" changes nom's API #843
Comments
hello, there's a workaround in nom 4: the errors are now an enum, and the one from |
@Geal, what do you mean by workaround? How do I actually handle the error in a way that won't break if match context {
Context::Code(input, error) => { ... },
_ => unreachable!(),
} This generates a warning about unreachable pattern and would panic if Can you please provide an example how to handle the error properly? |
This commit works around rust-bakery/nom#843 where the API of the `nom` crate changes based on feature selection, meaning we need to be compatible even if another crate in the crate graph enables a feature. Ideally this'd be fixed in upstream `nom`, and it looks like it will in the next major version! For now a local catch-all directive should help out.
|
Prerequisites
Here are a few things you should provide to help me understand the issue:
The
verbose-errors
feature changesnom
's API by changing the definition of theIResult
type in a non-compatible way. This means that enabling the feature will break downstream users which don't expect it.Since
cargo
always accumulates features across the dependency graph, if there are two users ofnom
within the same dep graph, and one enabledverbose-errors
, it will break the other user which doesn't want it.This is because in general cargo expects features to extend the functionality of a crate in a compatible way.
It would be better to make the
verbose-
andsimple-
explicit separate parts of the exposed API so that you can just use the API you want from a single instance of the crate.cc: @alexcrichton
The text was updated successfully, but these errors were encountered: