-
Notifications
You must be signed in to change notification settings - Fork 805
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
cargo features (verbose-errors may be other?) should be additive #544
Comments
#457 😢 |
yes, that situation is annoying, but I really don't see how to make that particular feature additive. Others (std, stream, regex*) are fine, but I don't know for this one. |
@Geal You could turn Yes the fix is going to be a breaking change 😞 |
so this is now done as you said, with an enum. It's much cleaner to use :) |
seems I have to switch to nom4, this just broke my crate 🤕 well at last I did learn something new |
This ended up biting me now too. The docs here https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md, at least |
I don't think this has been fixed. I still see this in master: That means the following code would break if verbose-errors is enabled anywhere else in our dependency graph. extern crate nom;
use nom::simple_errors; Some cases of this causing breakage: |
Hm, everything from `*_errors` is re-exported so the modules could be
private.
Alternatively re-exporting them through
a common module name (`errors`) is
also an option.
…On Wed, Jun 27, 2018, 08:12 David Tolnay ***@***.***> wrote:
I don't think this has been fixed. I still see this in master:
https://github.com/Geal/nom/blob/a88a6f8d3fe3cf41ef682bbfec1fd72f08edcf95/src/lib.rs#L434-L436
That means the following code would break if verbose-errors is enabled
anywhere else in our dependency graph.
extern crate nom;
use nom::simple_errors;
Some cases of this causing breakage:
- *A dependency compiles on it's own, but does not compile as
dependency (lettre & nom)*
<https://users.rust-lang.org/t/a-dependency-compiles-on-its-own-but-does-not-compile-as-dependency-lettre-nom/18097>
- *Macro failure only when depending on a project having bindgen as a
build dependency.*
<rust-lang/rust-bindgen#1287>
- *Build 0.8.2 fails to compile against nom 3.2.1*
<lettre/lettre#298>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#544 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHR0kVO4zP5ULvPOOGhVcSj3L1zZTCy2ks5uAyJXgaJpZM4Oi-EM>
.
|
As a workaround to rust-bakery/nom#544, migrate to nom 4 to ensure that the verbose-errors feature becomes additive and therefore portus compiles when used as a dependency. There were two classes of changes to the parser structure: 1. Error handling, as predicted and outlined here: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#replacing-parser-result-matchers 2. Migration to "CompleteByteSlice". This was predicted in the migration notes: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#dealing-with-incomplete-usage but caused underlying errors as reported here: rust-bakery/nom#790 (comment) To address this, shadow nom's `named!` macro with our own, `named_complete!`, which replaces the types appropriately. This is the solution proposed here: rust-bakery/nom#795 (comment)
As a workaround to rust-bakery/nom#544, migrate to nom 4 to ensure that the verbose-errors feature becomes additive and therefore portus compiles when used as a dependency. There were two classes of changes to the parser structure: 1. Error handling, as predicted and outlined here: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#replacing-parser-result-matchers 2. Migration to "CompleteByteSlice". This was predicted in the migration notes: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#dealing-with-incomplete-usage but caused underlying errors as reported here: rust-bakery/nom#790 (comment) To address this, shadow nom's `named!` macro with our own, `named_complete!`, which replaces the types appropriately. This is the solution proposed here: rust-bakery/nom#795 (comment)
As a workaround to rust-bakery/nom#544, migrate to nom 4 to ensure that the verbose-errors feature becomes additive and therefore portus compiles when used as a dependency. There were two classes of changes to the parser structure: 1. Error handling, as predicted and outlined here: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#replacing-parser-result-matchers 2. Migration to "CompleteByteSlice". This was predicted in the migration notes: https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_4.md#dealing-with-incomplete-usage but caused underlying errors as reported here: rust-bakery/nom#790 (comment) To address this, shadow nom's `named!` macro with our own, `named_complete!`, which replaces the types appropriately. This is the solution proposed here: rust-bakery/nom#795 (comment)
As desribed rust-lang/cargo#4323, see @kennytm comment here:
The text was updated successfully, but these errors were encountered: