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

Support #![no_std] #96

Closed
maxbla opened this issue Jun 24, 2019 · 9 comments
Closed

Support #![no_std] #96

maxbla opened this issue Jun 24, 2019 · 9 comments
Assignees

Comments

@maxbla
Copy link
Contributor

maxbla commented Jun 24, 2019

From the readme

In the future, we hope to support #![no_std] with the alloc crate when std is not enabled.

It was my understanding that we were holding back on this until alloc was stabilized, which happened fairly recently, in 1.28

@cuviper
Copy link
Member

cuviper commented Jun 24, 2019

If you check the links, those stabilized alloc APIs were actually just for the module alloc, accessible through core::alloc or std::alloc, and these are just the raw allocator APIs.

The alloc crate will finally be stabilized in 1.36 (rust-lang/rust#59675), which will include the alloc::vec::Vec we need to easily support num-bigint.

@maxbla
Copy link
Contributor Author

maxbla commented Jun 24, 2019

Hm, I didn't realize what exactly we needed when writing this issue, but alloc::vec::Vec makes more sense. 1.36 will probably be released around the end of June. We could just keep this issue open until then.

@cuviper
Copy link
Member

cuviper commented Jun 24, 2019

Yeah, that's fine. I'm even going to self-assign this, because I have a WIP branch around here somewhere... :)

@cuviper cuviper self-assigned this Jun 24, 2019
@0ndorio
Copy link

0ndorio commented Jul 8, 2019

As 1.36 was release last week it would now be possible to attack that issue again. Can I somehow help to make it happen?

@meltinglava
Copy link

Tried this. Looks like std::error::Error trait does not have a alloc or core counterpart. Do not know how to solve that. Do you want me to make an WIP PR?

@cuviper
Copy link
Member

cuviper commented Aug 1, 2019

Yeah, Error will need to a cfg for std only.

As mentioned, I do have a WIP branch myself, just need to get around to it. I will try to do this soon...

@cuviper
Copy link
Member

cuviper commented Aug 1, 2019

See draft PR #101, if you'd like to test.

@SOF3
Copy link

SOF3 commented Jan 20, 2020

Why is this issue not closed, since feature std is already in Cargo.toml?

@cuviper
Copy link
Member

cuviper commented Jan 20, 2020

Ah, I just forgot to link from the PR to close this.

@cuviper cuviper closed this as completed Jan 20, 2020
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

5 participants