diff --git a/crates/runtime/src/externref.rs b/crates/runtime/src/externref.rs index 9477acd4fd65..4da7cc55d105 100644 --- a/crates/runtime/src/externref.rs +++ b/crates/runtime/src/externref.rs @@ -165,6 +165,12 @@ use wasmtime_environ::StackMap; #[repr(transparent)] pub struct VMExternRef(NonNull); +impl std::fmt::Pointer for VMExternRef { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Pointer::fmt(&self.0, f) + } +} + // Data contained is always Send+Sync so these should be safe. unsafe impl Send for VMExternRef {} unsafe impl Sync for VMExternRef {} diff --git a/crates/wasmtime/src/ref.rs b/crates/wasmtime/src/ref.rs index f999b96d80a2..7845a4f7ea7d 100644 --- a/crates/wasmtime/src/ref.rs +++ b/crates/wasmtime/src/ref.rs @@ -100,3 +100,9 @@ impl ExternRef { externref_ptr as usize } } + +impl std::fmt::Pointer for ExternRef { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Pointer::fmt(&self.inner, f) + } +}