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

Use hashbrown for std in addition to no_std builds #185

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exclude = [ "/res/*", "/tests/*", "/fuzz/*", "/benches/*" ]
[dependencies]
wasmi-validation = { version = "0.1", path = "validation", default-features = false }
parity-wasm = { version = "0.31", default-features = false }
hashbrown = { version = "0.1.8", optional = true }
hashbrown = "0.4.0"
memory_units = "0.3.0"
libm = { version = "0.1.2", optional = true }

Expand All @@ -30,7 +30,6 @@ std = [
"wasmi-validation/std",
]
# Enable for no_std support
# hashbrown only works on no_std
core = [
"wasmi-validation/core",
"hashbrown/nightly",
Expand Down
3 changes: 0 additions & 3 deletions src/imports.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#[allow(unused_imports)]
use alloc::prelude::v1::*;

#[cfg(not(feature = "std"))]
use hashbrown::HashMap;
#[cfg(feature = "std")]
use std::collections::HashMap;

use func::FuncRef;
use global::GlobalRef;
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ extern crate assert_matches;
#[cfg(test)]
extern crate wabt;

#[cfg(not(feature = "std"))]
extern crate hashbrown;
extern crate memory_units as memory_units_crate;
extern crate parity_wasm;
Expand Down
3 changes: 0 additions & 3 deletions src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ use core::cell::RefCell;
use core::fmt;
use Trap;

#[cfg(not(feature = "std"))]
use hashbrown::HashMap;
#[cfg(feature = "std")]
use std::collections::HashMap;

use core::cell::Ref;
use func::{FuncBody, FuncInstance, FuncRef};
Expand Down
2 changes: 1 addition & 1 deletion validation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Wasm code validator"

[dependencies]
parity-wasm = { version = "0.31", default-features = false }
hashbrown = { version = "0.1.8", optional = true }
hashbrown = "0.4.0"

[dev-dependencies]
assert_matches = "1.1"
Expand Down
3 changes: 0 additions & 3 deletions validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ use core::fmt;
#[cfg(feature = "std")]
use std::error;

#[cfg(not(feature = "std"))]
use hashbrown::HashSet;
#[cfg(feature = "std")]
use std::collections::HashSet;

use self::context::ModuleContextBuilder;
use parity_wasm::elements::{
Expand Down