-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat: no_std support #12
Conversation
Wow, that is a very small change, did not expect that. I guess it was good I switched to |
So I did a quick test, and turns out testing with no_std isn't enough, we need to build for a target that actually has no std crate, otherwise it might still get implicitly linked... So I tried compiling for an embedded arm target (
I also hit another problem trying to compile for an embedded arm target: I think the build.rs probe function is broken in cross-compiling scenario? It doesn't seem to be passing the target through. We should probably be using |
yeah agreed, I inherited that |
Fun, do you think it makes sense to backfill them in here, or to get them in upstream? |
fn log2(x: u32) -> u32 {
assert!(x > 0);
num_bits::<u32>() as u32 - x.leading_zeros() - 1
}
|
Lets pull in |
ugh. I'm hitting this stupid cargo bug again: rust-lang/cargo#4866 Specifically, criterion is activating the std feature of num-trait. I'm unsure how to proceed. |
I pushed everything I have so far. What's missing:
The later will need a bit of investigation, I've got zero clue what is going on there. |
I moved the benchmark to a separate crate, fixing bullet point 1. As for the second bullet point... I can't reproduce it anymore? I So now all we have to do is wait for smallvec and it should be good to merge. |
can you add some notes to the readme on using the no_std version please? |
Sure! Should I also add some information in the lib.rs module documentation? |
yes that would be great
…On 18. Aug 2019, 17:58 +0200, Robin Lambertz ***@***.***>, wrote:
Sure! Should I also add some information in the lib.rs module documentation?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@roblabla it looks like a smallvec update is still not in sight. How about we change this such that using |
It already works on nightly (just had a small broken test, last commit should fix it). It will fail to build on stable with a confusing error (as seen on CI) until smallvec publishes an update. Should I update the CI so that it only runs no_std build on nightly for now? |
Yes please, and add a note about it to the docs. Then I'll merge and publish this, and we can update it whenever smallvec does a new release |
"A small broken test" might have been an underestimation lol (most tests required minor tweaks). This should be good to go for merging now. |
Thank you for all the work on this! |
Blocking on servo/rust-smallvec#160
Fixes #11
Was easier than I thought it would be 👀