about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-01 12:08:35 +0000
committerbors <bors@rust-lang.org>2021-10-01 12:08:35 +0000
commited937594d3912ced11f6f35a90bb8bf591909d2a (patch)
tree95edf1b0038137357bbdd422d6f13bf866686a7a
parent69eb996b2617621c7088e567089a86a6657f2a0f (diff)
parentf5e4f78eb7e3bad90b8dbbd20c58426817a4ffbf (diff)
Auto merge of #89403 - camsteffen:fmt-unsafe-private, r=Mark-Simulacrum
Add private arg to fmt::UnsafeArg

As discussed [here](https://github.com/rust-lang/rust/pull/89139#discussion_r719467357)

r? `@Mark-Simulacrum`
-rw-r--r--library/core/src/fmt/mod.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs
index 3a0c19d7de5..31da3ef87b9 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: () }
     }
 }