Skip to content

Add features to work with no_std, and with alloc in no_std #256

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

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

ChocolateLoverRaj
Copy link
Contributor

Closes #255

3 levels:
no_std without alloc: some stuff works
no_std with alloc: some more stuff works
std: everything works

Tested by using console::strip_ansi_codes in my OS, on x86_64-unknown-none with the alloc feature.

@djc
Copy link
Member

djc commented Jun 5, 2025

Please include #![warn(clippy::std_instead_of_core, clippy::std_instead_of_alloc)] in the crate root.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

A few more nits -- should be straightforward. Please squash your changes into a single commit.

@ChocolateLoverRaj
Copy link
Contributor Author

I squashed and force pushed.

@djc
Copy link
Member

djc commented Jun 8, 2025

Looks like the WASM situation needs a little work. Otherwise this is looking good!

Always include std feature in make tests

I would assume all of the tests require std since this crate originally was std only

Add clippy warnings to always use `core` and `alloc` instead of `std`

Fix clippy by replacing std with core and alloc when possible

Some changes

Add --lib when testing without default features

Make windows and wasm modules require std feature.
@ChocolateLoverRaj
Copy link
Contributor Author

I made wasm and windows require the "std" feature now so it should work.

@djc djc merged commit 18760c9 into console-rs:main Jun 13, 2025
15 checks passed
@djc
Copy link
Member

djc commented Jun 13, 2025

Thanks!

@djc djc mentioned this pull request Jun 13, 2025
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.

Add no_std support
2 participants