-
Notifications
You must be signed in to change notification settings - Fork 51
Conversation
Ah, that's not quite what I'd meant. 😛 The "purely additive" property is about the exposed API surface; if To explain a bit, there are the following possibilities:
1 and 2 are kosher; 3 and 4 are not. |
@eternaleye The problem that I ran into is that I couldn't find a way to tell Cargo to add hashmap_core as a dependency in non- |
[target.'cfg(not(feature = "std"))'.dependencies]
hashmap_core = "0.1.2" |
@eternaleye When I try that, it pulls in hashmap_core for $ git diff
diff --git a/Cargo.toml b/Cargo.toml
index 08bc406..aead01a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,17 +12,12 @@ exclude = ["fuzz/"]
[dependencies]
-[dependencies.hashmap_core]
-version = "0.1.1"
-optional = true
+[target.'cfg(not(feature = "std"))'.dependencies]
+hashmap_core = { version = "0.1.2" }
[badges]
travis-ci = { repository = "yurydelendik/wasmparser.rs" }
[features]
-# The "std" feature enables use of libstd. The "no_std" feature enables use
-# of some minimal std-like replacement libraries. At least one of these two
-# features needs to be enabled.
default = ["std"]
std = []
-no_std = ["hashmap_core"]
$ cargo build
Compiling hashmap_core v0.1.2
[...] We specifically want to avoid pulling in hashmap_core in |
Ugh, looks like I was mistaken, and there's no way to do that currently. I would suggest renaming the |
@eternaleye Sounds good, I've renamed |
Ok, I'm taking the liberty of merging this. Even though |
Updates the requirements on [wasmparser](https://github.com/bytecodealliance/wasmparser.rs) to permit the latest version. - [Release notes](https://github.com/bytecodealliance/wasmparser.rs/releases) - [Commits](https://github.com/bytecodealliance/wasmparser.rs/commits) Signed-off-by: dependabot-preview[bot] <[email protected]>
This adds
no_std
support to wasmparser.rs.@eternaleye I've attempted to follow your advice in bytecodealliance/cranelift#224 and use features additively, so I'm curious if you have any comments. wasmparser.rs uses
HashSet
internally, so to enable use ofhashmap_core
in an additive way, I've also created ano_std
feature which enables that. You can enable bothstd
andno_std
at the same time, and it behaves like astd
build. But you have to enable at least one of the two.