diff --git a/crates/core/src/alloc/try_clone.rs b/crates/core/src/alloc/try_clone.rs index 09d03975bb18..c59b62380b5e 100644 --- a/crates/core/src/alloc/try_clone.rs +++ b/crates/core/src/alloc/try_clone.rs @@ -104,7 +104,6 @@ impl_try_clone_via_clone! { std::hash::RandomState } -#[cfg(not(feature = "std"))] impl_try_clone_via_clone! { hashbrown::DefaultHashBuilder } diff --git a/crates/environ/src/lib.rs b/crates/environ/src/lib.rs index 29806dd0b3ea..f7bd814eaea8 100644 --- a/crates/environ/src/lib.rs +++ b/crates/environ/src/lib.rs @@ -36,6 +36,7 @@ mod ref_bits; mod scopevec; mod stack_map; mod stack_switching; +mod string_pool; mod trap_encoding; mod tunables; mod types; @@ -57,6 +58,7 @@ pub use crate::ref_bits::*; pub use crate::scopevec::ScopeVec; pub use crate::stack_map::*; pub use crate::stack_switching::*; +pub use crate::string_pool::{Atom, StringPool}; pub use crate::trap_encoding::*; pub use crate::tunables::*; pub use crate::types::*; diff --git a/crates/wasmtime/src/runtime/string_pool.rs b/crates/environ/src/string_pool.rs similarity index 98% rename from crates/wasmtime/src/runtime/string_pool.rs rename to crates/environ/src/string_pool.rs index 3c01d42e629e..e4ecda55fe22 100644 --- a/crates/wasmtime/src/runtime/string_pool.rs +++ b/crates/environ/src/string_pool.rs @@ -1,9 +1,12 @@ //! Simple string interning. -use crate::{error::OutOfMemory, prelude::*}; +use crate::{ + collections::{HashMap, String, Vec}, + error::OutOfMemory, + prelude::*, +}; use core::{fmt, mem, num::NonZeroU32}; use wasmtime_core::alloc::TryClone; -use wasmtime_environ::collections::{HashMap, String, Vec}; /// A pool of interned strings. /// diff --git a/crates/wasmtime/src/runtime.rs b/crates/wasmtime/src/runtime.rs index 471e0daf469e..e9417931a25c 100644 --- a/crates/wasmtime/src/runtime.rs +++ b/crates/wasmtime/src/runtime.rs @@ -49,7 +49,6 @@ pub(crate) mod module; pub(crate) mod native_debug; pub(crate) mod resources; pub(crate) mod store; -pub(crate) mod string_pool; pub(crate) mod trampoline; pub(crate) mod trap; pub(crate) mod type_registry; diff --git a/crates/wasmtime/src/runtime/linker.rs b/crates/wasmtime/src/runtime/linker.rs index 5ba1859e5142..0c4fb71f3a82 100644 --- a/crates/wasmtime/src/runtime/linker.rs +++ b/crates/wasmtime/src/runtime/linker.rs @@ -1,7 +1,6 @@ use crate::error::OutOfMemory; use crate::func::HostFunc; use crate::instance::InstancePre; -use crate::runtime::string_pool::{Atom, StringPool}; use crate::store::StoreOpaque; use crate::{ AsContext, AsContextMut, Caller, Engine, Extern, ExternType, Func, FuncType, ImportType, @@ -15,7 +14,7 @@ use core::marker; use core::mem::MaybeUninit; use log::warn; use wasmtime_environ::{ - PanicOnOom as _, + Atom, PanicOnOom as _, StringPool, collections::{HashMap, TryClone}, };