Skip to content

Commit

Permalink
Auto merge of #89403 - camsteffen:fmt-unsafe-private, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add private arg to fmt::UnsafeArg

As discussed [here](#89139 (comment))

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Oct 1, 2021
2 parents 69eb996 + f5e4f78 commit ed93759
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/core/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: () }
}
}

Expand Down

0 comments on commit ed93759

Please sign in to comment.