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`
This commit is contained in:
bors 2021-10-01 12:08:35 +00:00
commit ed937594d3

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