From c63b0ceb94c4c953f080ff0c543a950737408ff7 Mon Sep 17 00:00:00 2001 From: Jubilee <46493976+workingjubilee@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:28:46 -0700 Subject: [PATCH] thread_local: refine LazyKeyInner::take safety doc Co-authored-by: joboet --- library/std/src/sys/thread_local/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/thread_local/mod.rs b/library/std/src/sys/thread_local/mod.rs index 4fcea052ed0..7500c95d8b4 100644 --- a/library/std/src/sys/thread_local/mod.rs +++ b/library/std/src/sys/thread_local/mod.rs @@ -94,7 +94,7 @@ pub unsafe fn initialize T>(&self, init: F) -> &'static T { /// Watch out: unsynchronized internal mutability! /// /// # Safety - /// Unsound if called while any `&'static T` is active. + /// Causes UB if any reference to the value is used after this. #[allow(unused)] pub(crate) unsafe fn take(&self) -> Option { let mutable: *mut _ = UnsafeCell::get(&self.inner);