We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7b5730 commit 061d873Copy full SHA for 061d873
library/std/src/thread/mod.rs
@@ -686,6 +686,8 @@ thread_local! {
686
///
687
/// Aborts if the handle has been set already to reduce code size.
688
pub(crate) fn set_current(thread: Thread) {
689
+ // Using `unwrap` here can add ~3kB to the binary size. We have complete
690
+ // control over where this is called, so just abort if there is a bug.
691
CURRENT.with(|current| match current.set(thread) {
692
Ok(()) => {}
693
Err(_) => rtabort!("should only be set once"),
0 commit comments