diff --git a/crates/environ/src/fact/trampoline.rs b/crates/environ/src/fact/trampoline.rs index f41699ed76..faaf32d3ea 100644 --- a/crates/environ/src/fact/trampoline.rs +++ b/crates/environ/src/fact/trampoline.rs @@ -1574,7 +1574,7 @@ impl Compiler<'_, '_> { // If the byte size of memory is greater than the final address of the // string then the string is invalid. Note that if it's precisely equal // then that's ok. - self.instruction(I64GtU); + self.instruction(I64GeU); self.instruction(BrIf(1)); self.instruction(End); diff --git a/crates/wasmtime/src/component/values.rs b/crates/wasmtime/src/component/values.rs index b2e2b75cb1..3c85f857ce 100644 --- a/crates/wasmtime/src/component/values.rs +++ b/crates/wasmtime/src/component/values.rs @@ -127,7 +127,7 @@ impl fmt::Debug for Record { } } -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub struct Tuple { ty: types::Tuple, values: Box<[Val]>, @@ -166,6 +166,16 @@ impl Tuple { } } +impl fmt::Debug for Tuple { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let mut tuple = f.debug_tuple(""); + for val in self.values() { + tuple.field(val); + } + tuple.finish() + } +} + #[derive(PartialEq, Eq, Clone)] pub struct Variant { ty: types::Variant, @@ -227,7 +237,7 @@ impl fmt::Debug for Variant { } } -#[derive(Debug, PartialEq, Eq, Clone)] +#[derive(PartialEq, Eq, Clone)] pub struct Enum { ty: types::Enum, discriminant: u32, @@ -259,7 +269,13 @@ impl Enum { } } -#[derive(Debug, PartialEq, Eq, Clone)] +impl fmt::Debug for Enum { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Display::fmt(&self.discriminant(), f) + } +} + +#[derive(PartialEq, Eq, Clone)] pub struct Union { ty: types::Union, discriminant: u32, @@ -303,6 +319,14 @@ impl Union { } } +impl fmt::Debug for Union { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple(&format!("U{}", self.discriminant())) + .field(self.payload()) + .finish() + } +} + #[derive(PartialEq, Eq, Clone)] pub struct Option { ty: types::Option,