From d47eb44e855dad3a1a9e4ba91ccfb5c193f90b8a Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Tue, 20 Jun 2023 11:59:42 +0200 Subject: [PATCH] Fix libfmt errors from not finding enum formatter Recent versions of libfmt have become more strict and require `enum` types to be formattable: static assertion failed due to requirement 'formattable': Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt This is a quick fix to simply use the underlying type. --- folly/futures/detail/Core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/folly/futures/detail/Core.cpp b/folly/futures/detail/Core.cpp index 858229100f9..ef0ccbce5a0 100644 --- a/folly/futures/detail/Core.cpp +++ b/folly/futures/detail/Core.cpp @@ -29,8 +29,10 @@ namespace { template void terminate_unexpected_state(fmt::string_view context, Enum state) { - terminate_with( - fmt::format("{} unexpected state: {}", context, state)); + terminate_with(fmt::format( + "{} unexpected state: {}", + context, + static_cast>(state))); } } // namespace