Skip to content

Building for no_std environment (--no-default-features) fails on nightly. #546

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

Closed
jasondavies opened this issue Aug 2, 2017 · 3 comments
Milestone

Comments

@jasondavies
Copy link

Apologies if I'm missing something, but when attempting to build for no_std, I get the following errors:

% cargo build --no-default-features
   Compiling nom v3.2.0 (file:///Users/jason/src/nom)
error[E0432]: unresolved import `collections::boxed`
   --> src/lib.rs:423:25
    |
423 |   pub use collections::{boxed, vec, string};
    |                         ^^^^^ no `boxed` in the root

error[E0412]: cannot find type `Box` in this scope
  --> src/nom.rs:23:39
   |
23 | pub fn tag_cl<'a,'b>(rec:&'a[u8]) ->  Box<Fn(&'b[u8]) -> IResult<&'b[u8], &'b[u8]> + 'a> {
   |                                       ^^^ not found in this scope

error[E0433]: failed to resolve. Use of undeclared type or module `Box`
  --> src/nom.rs:24:3
   |
24 |   Box::new(move |i: &'b[u8]| -> IResult<&'b[u8], &'b[u8]> {
   |   ^^^ Use of undeclared type or module `Box`

error: aborting due to 3 previous errors

error: Could not compile `nom`.

To learn more, run the command again with --verbose.

Related #473.

% rustc --version
rustc 1.21.0-nightly (dd53dd5f9 2017-08-01)
@jasondavies
Copy link
Author

Oh, just discovered #537, which seems to resolve the errors.

@Geal Geal added this to the 4.0 milestone Sep 6, 2017
@Geal
Copy link
Collaborator

Geal commented Oct 30, 2017

Hi, the PR has been merged in the "result" branch and will be available for nom 4.0

@Geal
Copy link
Collaborator

Geal commented Apr 8, 2018

there's been follow-up work on that, and now since 9b12a2d there's an internal module (lib) that imports stuff from alloc and std if specified.
The interesting part being that the parts requiring std are very reduced now, and you can specify alloc to get many0 and many1

@Geal Geal closed this as completed May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants