From f5e4f78eb7e3bad90b8dbbd20c58426817a4ffbf Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Thu, 30 Sep 2021 12:06:30 -0500 Subject: [PATCH] Add private arg to fmt::UnsafeArg --- library/core/src/fmt/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 3a0c19d7de56f..31da3ef87b951 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -270,9 +270,10 @@ pub struct ArgumentV1<'a> { /// of `format_args!(..)` and reduce the scope of the `unsafe` block. #[allow(missing_debug_implementations)] #[doc(hidden)] -#[non_exhaustive] #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")] -pub struct UnsafeArg; +pub struct UnsafeArg { + _private: (), +} impl UnsafeArg { /// See documentation where `UnsafeArg` is required to know when it is safe to @@ -281,7 +282,7 @@ impl UnsafeArg { #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")] #[inline(always)] pub unsafe fn new() -> Self { - Self + Self { _private: () } } }