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

no_std gating - gate-in alloc #36

Closed
Tracked by #51
pinkforest opened this issue Mar 15, 2024 · 2 comments · Fixed by #62
Closed
Tracked by #51

no_std gating - gate-in alloc #36

pinkforest opened this issue Mar 15, 2024 · 2 comments · Fixed by #62

Comments

@pinkforest
Copy link
Contributor

There are feature gates for std that could be under alloc perhaps ? e.g.

#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
use alloc::format;
use alloc::sync::Arc;
use core::marker::PhantomData;

Trouble is current rustls largely needs alloc - nonetheless

We could have all alloc gated as feature as there is talk of having Arc-less version that doesn't require Alloc ?

@newpavlov
Copy link
Member

Yes, these should be under the alloc feature. We could leave stub like this for the time being:

#[cfg(not(feature = "alloc"))]
compile_error!("Rustls currently does not support alloc-less environments");

@pinkforest pinkforest mentioned this issue Mar 16, 2024
12 tasks
@Taowyoo
Copy link
Contributor

Taowyoo commented Apr 13, 2024

Willing to take this.
I think the PR just need to update feature gate on those ::alloc imports.

tarcieri pushed a commit that referenced this issue Apr 14, 2024
Gate all `alloc` usage with feature `alloc` instead of not std.

Update CI to check `alloc` feature only build & test.

Resolves #36.
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 a pull request may close this issue.

3 participants