Skip to content

Commit

Permalink
thread_local: refine LazyKeyInner::take safety doc
Browse files Browse the repository at this point in the history
Co-authored-by: joboet <[email protected]>
  • Loading branch information
workingjubilee and joboet authored Apr 27, 2024
1 parent 43f21a6 commit c63b0ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/thread_local/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ mod lazy {
/// 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);
Expand Down

0 comments on commit c63b0ce

Please sign in to comment.