thread_local: refine LazyKeyInner::take safety doc
Co-authored-by: joboet <jonasboettiger@icloud.com>
This commit is contained in:
parent
43f21a6871
commit
c63b0ceb94
@ -94,7 +94,7 @@ pub unsafe fn initialize<F: FnOnce() -> 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<T> {
|
||||
let mutable: *mut _ = UnsafeCell::get(&self.inner);
|
||||
|
Loading…
Reference in New Issue
Block a user