-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update nom dependency in Cargo.toml #47
Conversation
This change is necessary to allow nom_locate to be used without using the default features of nom, e.g. "lexical".
@fflorent would you mind merging this change so that we can use nom_locate without needing to include all the default dependencies of nom, such as "lexical-core". |
@rekanorman I'll review this later in the week |
@progval thanks! |
@progval just checking if there's any update on this? |
Ugh sorry, I still haven't found the time to look at this |
Okay, that looks good to me. Could you just fix the tests so they run on Travis? This would mostly involve skipping some tests (eg. I don't think it's possible to make FEATURES="allow" work on stable or beta, so you should tell Travis that they are allowed to fail |
Since a lot of stuff in nom_locate depends on nom having the "std" feature, it probably makes sense to require this feature. Other nom features such as "regexp" and "lexical" will still be optional.
…loc feature." This reverts commit 6b72f8b.
Thanks for taking a look. It looks like the line Instead of allowing the tests to fail on stable and beta, I thought it might be nicer to just require the "std" feature in the nom dependency. The "lexical" feature will still be optional. Let me know what you think. If you'd prefer to allow the tests to fail instead, I'm happy to make this change. |
hmm, last I checked, the I'll look into it later.
No, |
…loc" on stable/beta.
That makes sense. Sorry, I was confused before and didn't understand that alloc was a nightly-only feature. I belived I've made the correct change now, let me know what you think. |
.travis.yml
Outdated
- rust: stable | ||
env: FEATURES='alloc' | ||
- rust: stable | ||
env: FEATURES='' | ||
|
||
- rust: beta | ||
env: FEATURES='default' | ||
- rust: beta | ||
env: FEATURES='alloc' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't remove these; the jobs should be in both (yeah I know, it doesn't make sense, but that's how Travis works)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last thing I should have caught earlier
tests/integration_tests.rs
Outdated
@@ -10,6 +10,7 @@ use std::ops::{Range, RangeFull}; | |||
type StrSpan<'a> = LocatedSpan<&'a str>; | |||
type BytesSpan<'a> = LocatedSpan<&'a [u8]>; | |||
|
|||
#[cfg(feature = "alloc")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be:
#[cfg(any(feature = "std", feature = "alloc"))]
because std does not imply alloc.
(same for the other occurences below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks! |
* Update nom dependency in Cargo.toml This change is necessary to allow nom_locate to be used without using the default features of nom, e.g. "lexical". * Change nom dependency to require "std" feature. Since a lot of stuff in nom_locate depends on nom having the "std" feature, it probably makes sense to require this feature. Other nom features such as "regexp" and "lexical" will still be optional. * Add #[cfg(feature = alloc)] to tests which require the nom alloc feature. * Revert "Add #[cfg(feature = alloc)] to tests which require the nom alloc feature." This reverts commit 6b72f8b. * Remove "std" feature from nom dependency, and allow failures with "alloc" on stable/beta. * Add removed jobs back to travis.yml include section. * Add missing quote * Change #[cfg(feature = "alloc")] to #[cfg(any(feature = "std", feature = "alloc"))]
Thanks for all your help! |
This change gives users the option of using nom_locate without needing to use the default features of nom, e.g. "lexical".