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

Fix no-std compatibility #4005

Merged
merged 3 commits into from
Jul 28, 2024
Merged

Fix no-std compatibility #4005

merged 3 commits into from
Jul 28, 2024

Conversation

Systemcluster
Copy link
Contributor

no-std support is currently non-functional. This PR does the following:

  • Replace the unconditional std imports with core and alloc counterparts
  • Remove most of the if_std! gates (Box, String and Vec are available in alloc)
  • Allow exporting classes without std
  • Add a check --no-default-features call to the check workflow

There are no behavioral changes.

Note: I assume wasm-bindgen with std disabled was initially supposed to be alloc-free, but considering it hasn't been functional without std for a while at all, I don't think it's necessary to keep that limitation. If necessary, a separate alloc feature instead might make sense.

externref, intern and take_last_exception/__wbindgen_exn_store remain std-gated due to use of std::thread_local!.

Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Apologies for the delay!
Thank you for doing this!

src/externref.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@daxpedda daxpedda force-pushed the fix-nostd branch 2 times, most recently from 831e9ca to 752c59a Compare July 28, 2024 21:52
@daxpedda daxpedda merged commit 06b347f into rustwasm:main Jul 28, 2024
25 checks passed
@Systemcluster Systemcluster deleted the fix-nostd branch July 29, 2024 14:11
@Systemcluster
Copy link
Contributor Author

Thanks for merging!

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.

2 participants