diff options
| -rw-r--r-- | library/std/src/thread/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index a97122ca120..ae3dfef4870 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -686,6 +686,8 @@ thread_local! { /// /// Aborts if the handle has been set already to reduce code size. pub(crate) fn set_current(thread: Thread) { + // Using `unwrap` here can add ~3kB to the binary size. We have complete + // control over where this is called, so just abort if there is a bug. CURRENT.with(|current| match current.set(thread) { Ok(()) => {} Err(_) => rtabort!("should only be set once"), |
