Skip to content

Commit ed93759

Browse files
committed
Auto merge of #89403 - camsteffen:fmt-unsafe-private, r=Mark-Simulacrum
Add private arg to fmt::UnsafeArg As discussed [here](#89139 (comment)) r? `@Mark-Simulacrum`
2 parents 69eb996 + f5e4f78 commit ed93759

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/core/src/fmt/mod.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,10 @@ pub struct ArgumentV1<'a> {
270270
/// of `format_args!(..)` and reduce the scope of the `unsafe` block.
271271
#[allow(missing_debug_implementations)]
272272
#[doc(hidden)]
273-
#[non_exhaustive]
274273
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
275-
pub struct UnsafeArg;
274+
pub struct UnsafeArg {
275+
_private: (),
276+
}
276277

277278
impl UnsafeArg {
278279
/// See documentation where `UnsafeArg` is required to know when it is safe to
@@ -281,7 +282,7 @@ impl UnsafeArg {
281282
#[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "none")]
282283
#[inline(always)]
283284
pub unsafe fn new() -> Self {
284-
Self
285+
Self { _private: () }
285286
}
286287
}
287288

0 commit comments

Comments
 (0)