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

Implement no_std support #34

Merged
merged 4 commits into from
Nov 12, 2019
Merged

Implement no_std support #34

merged 4 commits into from
Nov 12, 2019

Conversation

CryZe
Copy link
Contributor

@CryZe CryZe commented Aug 8, 2019

This implements no_std support for unicase. It adds a feature called std which is activated by default. no_std support has been implemented for every Rust version starting with 1.36 which added stable support for the alloc crate. All of unicase's features are available on no_std.

@CryZe
Copy link
Contributor Author

CryZe commented Aug 8, 2019

What I don't quite like is that I needed to add the feature at all. Since it doesn't really do anything, there shouldn't be any need for it. But examples in docs are apparently not compiled with cfg(test), so they are compiled without std, which then makes them complain that no global allocator is set. This is really stupid and should honestly be fixed in Rust's testing framework.

@seanmonstar
Copy link
Owner

So, is the purpose of the feature only so the doc tests can pass? If so, maybe we just make the feature semi-private, like __internal_docs_std or whatever.

@CryZe
Copy link
Contributor Author

CryZe commented Aug 26, 2019

I removed the feature entirely now. It's really just a bug in Rust's test framework and interestingly it still runs all of the tests and ends up returning a successful exit code regardless of it printing an error. And it seems like on nightly the bug is fixed anyway. So I'd say it's not worth adding a feature.

@CryZe CryZe force-pushed the no-std branch 2 times, most recently from 2735b2d to a3b01ca Compare September 6, 2019 13:21
This implements no_std support for unicase. It adds a feature called
`std` which is activated by default. no_std support has been implemented
for every Rust version starting with 1.36 which added stable support for
the alloc crate. All of unicase's features are available on no_std.
@CryZe
Copy link
Contributor Author

CryZe commented Sep 6, 2019

Rebased onto latest master.

@CryZe
Copy link
Contributor Author

CryZe commented Oct 4, 2019

What's the status of this PR? It's good to go from my side.

@CryZe
Copy link
Contributor Author

CryZe commented Nov 8, 2019

Can this be merged? I'm beginning to get blocked by this soon.

Copy link
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, sorry for forgetting about this!

@seanmonstar seanmonstar merged commit fbab380 into seanmonstar:master Nov 12, 2019
@CryZe
Copy link
Contributor Author

CryZe commented Nov 12, 2019

Thank you so much. Considering there's also not a lot going on in this repository (as unicase is in a fairly stable shape), would you mind creating a release for this as well? (Otherwise I fear it could possibly take quite a long time for another release).

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.

2 participants