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

more no_std support #471

Closed
wants to merge 1 commit into from

Conversation

zendurix
Copy link

@zendurix zendurix commented Aug 21, 2020

I have implemented most functions to be able to use in no_std with alloc (by using optional feature use_alloc). Also I have included optional crate hashbrown (it is used while using use_alloc) for no_std Hashmap.
Everything builds and tests are passing in both default and no default with feature use_alloc.
There are many changes due to cargo fmt, if this is a problem I can return them to previous formatting, however this will require some manual work.

@zendurix zendurix mentioned this pull request Aug 21, 2020
@jswrenn
Copy link
Member

jswrenn commented Aug 21, 2020

however this will require some manual work.

Massive patches create additional labor for reviewers. It's good etiquette to minimize patch size. Could you please submit which changes only the necessary lines?

@zendurix
Copy link
Author

however this will require some manual work.

Massive patches create additional labor for reviewers. It's good etiquette to minimize patch size. Could you please submit which changes only the necessary lines?

Do you mean to redo thoose cargo fmt changes, or just mark lines that I have changed ?

@jswrenn
Copy link
Member

jswrenn commented Aug 21, 2020

A PR without any cargo fmt changes. Marking the meaningful changes isn't sufficient: I trust that you did not sneak any changes in, but I cannot merge any PR without reviewing every modification.

PRs that change many lines are also very likely to invalidate other pull requests, creating additional work for those authors. The bigger the PR, the lower priority of review it tends to get.

@sollyucko
Copy link

FYI, you could probably git reset HEAD^ then git add --edit each file with useful changes, to select which changes to include.

@zendurix
Copy link
Author

I have fix the cargo fmt problem, only relevant changes are now left.
Please do cargo fmt after merge to avoid this next time :p

It passed no std check
https://github.com/mystor/cargo-no-std-check

@@ -24,6 +24,7 @@ test = false

[dependencies]
either = { version = "1.0", default-features = false }
hashbrown = { version = "0.8", optional = true}
Copy link
Member

Choose a reason for hiding this comment

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

Hashbrown doesn't seem to have a minimum-supported-Rust-version policy—Itertools does. We therefore can't just drop-in hashbrown as an alternative to std::collections::HashMap.

@jswrenn jswrenn mentioned this pull request Sep 4, 2020
@jswrenn
Copy link
Member

jswrenn commented Sep 4, 2020

I've opened #474, which implements a minimal use_alloc feature.

I'm happy to revisit porting HashMap support to use_alloc in the future, but I'd like to take a carefully considered, incremental approach to doing so.

@jswrenn jswrenn closed this Sep 4, 2020
bors bot added a commit that referenced this pull request Sep 22, 2020
474: Minimal `use_alloc` feature r=jswrenn a=jswrenn

Introduces a `use_alloc` feature.

**Breaking Change:** [**Increases the MSRV to 1.36.0**](https://blog.rust-lang.org/2019/07/04/Rust-1.36.0.html#the-alloc-crate-is-stable)

`Vec`, `String`, etc., use their alternatives defined in `alloc`.

No attempt is made to support `HashMap`, which is *not* defined in `alloc`. This is thus a more minimal introduction of `use_alloc` than #471.

Fixes #365.
Partially fixes #470. 

Co-authored-by: Jack Wrenn <me@jswrenn.com>
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.

None yet

3 participants