Implement std::fmt::Pointer for ExternRef (#4504)
This commit is contained in:
@@ -165,6 +165,12 @@ use wasmtime_environ::StackMap;
|
||||
#[repr(transparent)]
|
||||
pub struct VMExternRef(NonNull<VMExternData>);
|
||||
|
||||
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 {}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user