about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-24 13:35:50 +0000
committerbors <bors@rust-lang.org>2024-10-24 13:35:50 +0000
commitf61306d47bc98af8bb9d15f1adf6086785590a8c (patch)
tree0500da4d67b3ec4f77a8cb011074779c5c0315fb /tests/rustdoc
parent5ae4d75effa366176dd75cd0d5662da26385cfc5 (diff)
parent0747f2898e83df7e601189c0f31762e84328becb (diff)
downloadrust-f61306d47bc98af8bb9d15f1adf6086785590a8c.tar.gz
rust-f61306d47bc98af8bb9d15f1adf6086785590a8c.zip
Auto merge of #123550 - GnomedDev:remove-initial-arc, r=Noratrieb
Remove the `Arc` rt::init allocation for thread info

Removes an allocation pre-main by just not storing anything in std::thread::Thread for the main thread.
- The thread name can just be a hard coded literal, as was done in #123433.
- Storing ThreadId and Parker in a static that is initialized once at startup. This uses SyncUnsafeCell and MaybeUninit as this is quite performance critical and we don't need synchronization or to store a tag value and possibly leave in a panic.
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/demo-allocator-54478.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/rustdoc/demo-allocator-54478.rs b/tests/rustdoc/demo-allocator-54478.rs
index dd98e80f03a..80acfc0ff58 100644
--- a/tests/rustdoc/demo-allocator-54478.rs
+++ b/tests/rustdoc/demo-allocator-54478.rs
@@ -40,6 +40,7 @@
 //! }
 //!
 //! fn main() {
+//!     drop(String::from("An allocation"));
 //!     assert!(unsafe { HIT });
 //! }
 //! ```