Skip to content

Commit 8325e1e

Browse files
authored
Fold the wasmtime-error crate into wasmtime-core (bytecodealliance#12418)
Similar to bytecodealliance#12398 and bytecodealliance#12407 the idea is that all our dependency-free (mostly) data structures and foundational data-types are in one location to centralize testing, ergonomics, documentation, idioms, etc.
1 parent 21797bb commit 8325e1e

File tree

36 files changed

+106
-151
lines changed

36 files changed

+106
-151
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,6 @@ jobs:
11771177
- crate: "wasmtime-cli"
11781178
- crate: "wasmtime-environ --all-features"
11791179
- crate: "pulley-interpreter --all-features"
1180-
- crate: "wasmtime-internal-error"
1181-
- crate: "wasmtime-internal-error --all-features"
11821180
- crate: "wasmtime-internal-core"
11831181
- crate: "wasmtime-internal-core --all-features"
11841182
- script: ./ci/miri-provenance-test.sh

Cargo.lock

Lines changed: 3 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ members = [
158158
"cranelift/serde",
159159
"crates/bench-api",
160160
"crates/c-api/artifact",
161-
"crates/core",
162161
"crates/environ/fuzz",
163-
"crates/error",
164162
"crates/misc/component-async-tests",
165163
"crates/test-programs",
166164
"crates/wasi-preview1-component-adapter",
@@ -265,7 +263,6 @@ wasmtime-wast = { path = "crates/wast", version = "=42.0.0" }
265263
# part of the project organization of other public crates in Wasmtime and are
266264
# otherwise not supported in terms of CVEs for example.
267265
wasmtime-core = { path = "crates/core", version = "=42.0.0", package = 'wasmtime-internal-core' }
268-
wasmtime-error = { path = "crates/error", version = "=42.0.0", package = 'wasmtime-internal-error' }
269266
wasmtime-wmemcheck = { path = "crates/wmemcheck", version = "=42.0.0", package = 'wasmtime-internal-wmemcheck' }
270267
wasmtime-c-api-macros = { path = "crates/c-api-macros", version = "=42.0.0", package = 'wasmtime-internal-c-api-macros' }
271268
wasmtime-cache = { path = "crates/cache", version = "=42.0.0", package = 'wasmtime-internal-cache' }

cranelift/bitset/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ workspace = true
1616
arbitrary = { workspace = true, optional = true }
1717
serde = { workspace = true, optional = true }
1818
serde_derive = { workspace = true, optional = true }
19-
wasmtime-error = { workspace = true }
2019
wasmtime-core = { workspace = true }
2120

2221
[features]

cranelift/bitset/src/compound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::scalar::{self, ScalarBitSet, ScalarBitSetStorage};
44
use alloc::boxed::Box;
55
use core::{cmp, iter, mem};
6-
use wasmtime_error::OutOfMemory;
6+
use wasmtime_core::error::OutOfMemory;
77

88
/// A large bit set backed by dynamically-sized storage.
99
///

cranelift/entity/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ workspace = true
1919
cranelift-bitset = { workspace=true }
2020
serde = { workspace = true, optional = true }
2121
serde_derive = { workspace = true, optional = true }
22-
wasmtime-error = { workspace = true }
22+
wasmtime-core = { workspace = true }
2323

2424
[features]
2525
enable-serde = ["serde", "serde_derive", "cranelift-bitset/enable-serde"]

cranelift/entity/src/primary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use core::ops::{Index, IndexMut};
1111
use core::slice;
1212
#[cfg(feature = "enable-serde")]
1313
use serde_derive::{Deserialize, Serialize};
14-
use wasmtime_error::OutOfMemory;
14+
use wasmtime_core::error::OutOfMemory;
1515

1616
/// A primary mapping `K -> V` allocating dense entity references.
1717
///

cranelift/entity/src/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::keys::Keys;
55
use core::fmt;
66
use core::marker::PhantomData;
77
use cranelift_bitset::CompoundBitSet;
8-
use wasmtime_error::OutOfMemory;
8+
use wasmtime_core::error::OutOfMemory;
99

1010
/// A set of `K` for densely indexed entity references.
1111
///

crates/core/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ version.workspace = true
1010
[dependencies]
1111
# This crate should have *very* minimal dependencies! Don't add new ones
1212
# lightly.
13-
wasmtime-error = { workspace = true }
1413
libm = { workspace = true }
14+
anyhow = { workspace = true, optional = true }
1515

1616
[lints]
1717
workspace = true
1818

1919
[features]
20+
# Enable the use of the `std` crate.
2021
std = []
22+
# Enable backtraces in errors.
23+
backtrace = ["std"]
24+
# Enable the `From<Error> for anyhow::Error` implementation and
25+
# `Error::from_anyhow` constructor.
26+
anyhow = ["dep:anyhow"]

crates/core/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ mod try_new;
77
pub use boxed::{BoxedSliceFromIterError, new_boxed_slice_from_iter};
88
pub use try_new::{TryNew, try_new};
99

10+
use crate::error::OutOfMemory;
1011
use core::{alloc::Layout, ptr::NonNull};
11-
use wasmtime_error::OutOfMemory;
1212

1313
/// Try to allocate a block of memory that fits the given layout, or return an
1414
/// `OutOfMemory` error.

0 commit comments

Comments
 (0)