Add private arg to fmt::UnsafeArg

This commit is contained in:
Cameron Steffen 2021-09-30 12:06:30 -05:00
parent 6dc08b909b
commit f5e4f78eb7

View File

@ -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: () }
}
}