From 6d2f393f2b2b1fa428e8258a759736702ec1fce4 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 24 Apr 2025 15:43:12 +0100 Subject: [PATCH] LibGC: Make GC::Root formattable --- Libraries/LibGC/Root.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Libraries/LibGC/Root.h b/Libraries/LibGC/Root.h index eb9a2be3f2f..f9f100cea30 100644 --- a/Libraries/LibGC/Root.h +++ b/Libraries/LibGC/Root.h @@ -170,6 +170,14 @@ struct Traits> : public DefaultTraits> { static unsigned hash(GC::Root const& handle) { return Traits::hash(handle); } }; +template +struct Formatter> : Formatter { + ErrorOr format(FormatBuilder& builder, GC::Root const& value) + { + return Formatter::format(builder, value.ptr()); + } +}; + namespace Detail { template inline constexpr bool IsHashCompatible, T> = true;