Skip to content
Merged
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/environ/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ target-lexicon = { workspace = true }
wasm-encoder = { workspace = true, optional = true }
wasmprinter = { workspace = true, optional = true }
wasmtime-component-util = { workspace = true, optional = true }
wasmtime-error = { workspace = true }
semver = { workspace = true, optional = true, features = ['serde'] }
smallvec = { workspace = true, features = ['serde'] }

Expand All @@ -55,7 +56,7 @@ name = "factc"
required-features = ['component-model', 'compile']

[features]
anyhow = []
anyhow = ["wasmtime-error/anyhow"]
component-model = [
"dep:wasmtime-component-util",
"dep:semver",
Expand Down
20 changes: 4 additions & 16 deletions crates/environ/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,12 @@ pub mod fact;
// one of three and making sure you're using the right one.
pub use cranelift_entity::*;

// Temporarily re-export `anyhow` as `wasmtime_environ::error` to ease the
// migration to the `wasmtime-internal-error` crate.
pub use anyhow as error;
// Reexport the error crate as a submodule for convenience.
#[doc(inline)]
pub use wasmtime_error as error;

// Temporarily polyfill `wasmtime_internal_error::ToWasmtimeResult` to ease
// migration, before we swap out `anyhow` with the `wasmtime_internal_error`
// crate.
#[cfg(feature = "anyhow")]
#[doc(hidden)]
pub trait ToWasmtimeResult<T> {
fn to_wasmtime_result(self) -> self::error::Result<T>;
}
#[cfg(feature = "anyhow")]
impl<T> ToWasmtimeResult<T> for anyhow::Result<T> {
fn to_wasmtime_result(self) -> self::error::Result<T> {
self
}
}
pub use wasmtime_error::ToWasmtimeResult;

// Only for use with `bindgen!`-generated code.
#[doc(hidden)]
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const CRATES_TO_PUBLISH: &[&str] = &[
"cranelift-native",
"cranelift-object",
"cranelift-interpreter",
"wasmtime-internal-error",
"wasmtime-internal-component-util",
"wasmtime-environ",
"wasmtime-internal-jit-icache-coherence",
Expand All @@ -52,7 +53,6 @@ const CRATES_TO_PUBLISH: &[&str] = &[
"wiggle-generate",
"wiggle-macro",
// wasmtime
"wasmtime-internal-error",
"wasmtime-internal-versioned-export-macros",
"wasmtime-internal-slab",
"wasmtime-internal-wit-bindgen",
Expand Down
Loading