Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Through
no_std
support, we now also supportwasm32v1-none
.Introduced a new
std
crate feature that is enabled by default. Without it#[no_std]
is enabled, but only on Web! This allows Web target to build without std, which is now supported bywasm-bindgen
as well.Additionally, various changes had to be done to support
no_std
:no_std
does not supportthread_local!
, we useonce_cell
to polyfill this gap.once_cell
is not a new dependency, it is already a dependency ofwasm-bindgen
.feature = "std"
, we usethread_local!
as before.target_feature = "atomics"
, we use astatic mut
withonce_cell::unsync::Lazy
.#[thread_local]
withonce_cell::unsync::Lazy
.Some
f64
instructions are not available onno_std
and had to be polyfilled. For this code fromlibm
was copied. Which is used by std as well.SystemTimeError
now only implementsError
withfeature = "std"
.no_std
testing requires to refrain from using the default test harness. The problem was that native tests still needed to use the default test harness. To solve this, integration tests were removed from root crate and two workspace members added, that manually define all integration tests as test targets. Thetests-web
crate hasharness = false
on all tests, whiletests-native
functions regularly. This allow us to use the default test harness for native tests while disabling it for Web.Additionally, every test target requires the
run
crate feature, which are enabled by default depending on the target by the root crate. This way regular testing can function correctly for each target as long as--all-features
is not used. E.g.cargo test --workspace
andcargo test --workspace --target wasm32-unknown-unknown
will work correctly.The
tests-web
library is used to implement thepanic_handler
,global_allocator
andcritical_section
. It is always imported to reduce code duplication in all tests.Used
serde-json-core
to cover tests withno_std
as well.All links to std documentation had to be supplemented with manual link when
std
is not present.Improvements to CI:
--no-default-features
.cargo publish
.wasm-bindgen
update allows us to refrain from having to passcfg
flags to thewasm-bindgen
proc-macros.llvm-tools
instead of the official LLVM package.script
tag from coverage report.Small fixes that were stumbled upon:
web_time::web
withcfg(docsrs)
on native as well.Serialize
andDeserialize
implementation are now marked withdoc(cfg(feature = "serde"))
.stable
.-Ctarget-feature=+nontrapping-fptoint
was moved from the top-level to the "Usage" section.no_std
support forserde_test
: serde-deprecated/test#36no_std
support forgetrandom
: rust-random/getrandom#541.no_std
Wasmf64
instructions: rust-lang/stdarch#1677