Skip to content

Commit dabd016

Browse files
authored
add Debug impl to FuncToValidate and its uses (#1503)
1 parent df5368f commit dabd016

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

crates/wasmparser/src/validator/core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ impl ModuleState {
510510
}
511511
}
512512

513+
#[derive(Debug)]
513514
pub(crate) struct Module {
514515
// This is set once the code section starts.
515516
// `WasmModuleResources` implementations use the snapshot to
@@ -1271,6 +1272,7 @@ impl WasmModuleResources for OperatorValidatorResources<'_> {
12711272

12721273
/// The implementation of [`WasmModuleResources`] used by
12731274
/// [`Validator`](crate::Validator).
1275+
#[derive(Debug)]
12741276
pub struct ValidatorResources(pub(crate) Arc<Module>);
12751277

12761278
impl WasmModuleResources for ValidatorResources {

crates/wasmparser/src/validator/func.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::{FunctionBody, Operator, WasmFeatures, WasmModuleResources};
99
/// is created per-function in a WebAssembly module. This structure is suitable
1010
/// for sending to other threads while the original
1111
/// [`Validator`](crate::Validator) continues processing other functions.
12+
#[derive(Debug)]
1213
pub struct FuncToValidate<T> {
1314
/// Reusable, heap allocated resources to drive the Wasm validation.
1415
pub resources: T,

crates/wasmparser/src/validator/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2267,6 +2267,7 @@ where
22672267
//
22682268
// Only public because it shows up in a public trait's `doc(hidden)` method.
22692269
#[doc(hidden)]
2270+
#[derive(Debug)]
22702271
pub struct SnapshotList<T> {
22712272
// All previous snapshots, the "head" of the list that this type represents.
22722273
// The first entry in this pair is the starting index for all elements
@@ -2286,6 +2287,7 @@ pub struct SnapshotList<T> {
22862287
cur: Vec<T>,
22872288
}
22882289

2290+
#[derive(Debug)]
22892291
struct Snapshot<T> {
22902292
prior_types: usize,
22912293
items: Vec<T>,
@@ -2394,7 +2396,7 @@ impl<T> Default for SnapshotList<T> {
23942396
/// component model's {component, instance, defined, func} types are in the same
23952397
/// index space). However, we store each of them in their own type-specific
23962398
/// snapshot list and give each of them their own identifier type.
2397-
#[derive(Default)]
2399+
#[derive(Default, Debug)]
23982400
// Only public because it shows up in a public trait's `doc(hidden)` method.
23992401
#[doc(hidden)]
24002402
pub struct TypeList {

0 commit comments

Comments
 (0)