From 2ff5fd085dd8dc872eab3ad367a482e98f16f23a Mon Sep 17 00:00:00 2001 From: MrGunflame Date: Sun, 18 Dec 2022 20:58:12 +0100 Subject: [PATCH] Add fmt::Pointer impl for bevy_ptr::{Ptr, PtrMut, OwnedPtr} --- crates/bevy_ptr/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/bevy_ptr/src/lib.rs b/crates/bevy_ptr/src/lib.rs index 4aec221350cb6..2163e6478471b 100644 --- a/crates/bevy_ptr/src/lib.rs +++ b/crates/bevy_ptr/src/lib.rs @@ -2,6 +2,7 @@ #![no_std] #![warn(missing_docs)] +use core::fmt::{self, Formatter, Pointer}; use core::{ cell::UnsafeCell, marker::PhantomData, mem::ManuallyDrop, num::NonZeroUsize, ptr::NonNull, }; @@ -94,6 +95,13 @@ macro_rules! impl_ptr { Self(inner, PhantomData) } } + + impl Pointer for $ptr<'_> { + #[inline] + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + Pointer::fmt(&self.0, f) + } + } }; }