Skip to content

Commit 76c63c1

Browse files
committed
Explicitly make fmt::Arguments !Sync and !Send.
1 parent 629b5e7 commit 76c63c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/core/src/fmt/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ union Parts {
318318
strings_and_placeholders: (*const &'static str, *const rt::Placeholder),
319319
}
320320

321+
// `Arguments` will never be Send nor Sync, because it may borrow arguments that are not Sync.
322+
#[stable(feature = "rust1", since = "1.0.0")]
323+
impl !Sync for Arguments<'_> {}
324+
#[stable(feature = "rust1", since = "1.0.0")]
325+
impl !Send for Arguments<'_> {}
326+
321327
/// Used by the format_args!() macro to create a fmt::Arguments object.
322328
#[doc(hidden)]
323329
#[unstable(feature = "fmt_internals", issue = "none")]

0 commit comments

Comments
 (0)