diff options
| author | bors <bors@rust-lang.org> | 2021-10-01 12:08:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-01 12:08:35 +0000 |
| commit | ed937594d3912ced11f6f35a90bb8bf591909d2a (patch) | |
| tree | 95edf1b0038137357bbdd422d6f13bf866686a7a | |
| parent | 69eb996b2617621c7088e567089a86a6657f2a0f (diff) | |
| parent | f5e4f78eb7e3bad90b8dbbd20c58426817a4ffbf (diff) | |
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`
| -rw-r--r-- | library/core/src/fmt/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 3a0c19d7de5..31da3ef87b9 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -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: () } } } |
