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

Add no_std + alloc support by way of a default "std" feature flag #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZackPierce
Copy link

@ZackPierce ZackPierce commented May 7, 2018

What

The addition of a feature flag, and conditional compilation blocks to make utf8-ranges work in either std or no_std + alloc environments, very much in the same vein as BurntSushi/aho-corasick#28 .

The default-on "std" feature flag controls whether or not to compile in #![no_std] mode. As stated in the updated docs, due to the use of the presently-unstable alloc API, no_std mode only works with a nightly toolchain at present.

How

To build for std, nothing changes. cargo build

To build for no_std:

cargo build --no-default-features --features "alloc"

The test suites pass as normal in either mode.

Why

This PR is part of an effort to get regex and its dependencies to operate in no_std + alloc mode.

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

Successfully merging this pull request may close these issues.

1 participant