From a0004edad2f6fb7ecf36b6fa4a16eb3d4873cd2b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 1 Oct 2024 19:27:30 -0500 Subject: [PATCH] Remove a dead type in `wasmparser` (#1836) Must have been lost in one refactoring or another. Now it's no longer used though so go ahead and delete it. --- crates/wasmparser/src/validator/types.rs | 42 ------------------------ 1 file changed, 42 deletions(-) diff --git a/crates/wasmparser/src/validator/types.rs b/crates/wasmparser/src/validator/types.rs index 68ae202115..fd8e204f28 100644 --- a/crates/wasmparser/src/validator/types.rs +++ b/crates/wasmparser/src/validator/types.rs @@ -244,18 +244,6 @@ macro_rules! define_type_id { }; } -/// A core WebAssembly type, in the core WebAssembly types index space. -pub enum CoreType { - /// A sub type. - Sub(SubType), - - /// A module type. - /// - /// Does not actually appear in core Wasm at the moment. Only used for the - /// core types index space within components. - Module(ModuleType), -} - /// Represents a unique identifier for a core type type known to a /// [`crate::Validator`]. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -303,36 +291,6 @@ impl TypeData for SubType { } } -impl CoreType { - /// Get the underlying `SubType` or panic. - pub fn unwrap_sub(&self) -> &SubType { - match self { - CoreType::Sub(s) => s, - CoreType::Module(_) => panic!("`unwrap_sub` on module type"), - } - } - - /// Get the underlying `FuncType` within this `SubType` or panic. - pub fn unwrap_func(&self) -> &FuncType { - match &self.unwrap_sub().composite_type.inner { - CompositeInnerType::Func(f) => f, - CompositeInnerType::Array(_) - | CompositeInnerType::Struct(_) - | CompositeInnerType::Cont(_) => { - panic!("`unwrap_func` on non-func composite type") - } - } - } - - /// Get the underlying `ModuleType` or panic. - pub fn unwrap_module(&self) -> &ModuleType { - match self { - CoreType::Module(m) => m, - CoreType::Sub(_) => panic!("`unwrap_module` on a subtype"), - } - } -} - macro_rules! define_wrapper_id { ( $(#[$outer_attrs:meta])*