Skip to content

Commit

Permalink
Add private arg to fmt::UnsafeArg
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Sep 30, 2021
1 parent 6dc08b9 commit f5e4f78
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 f5e4f78

Please sign in to comment.