Skip to content

Commit

Permalink
OnceLock: Add note about drop and statics
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrrees committed Dec 4, 2023
1 parent 1d726a2 commit b79b687
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/std/src/sync/once_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ use crate::sync::Once;
/// # Examples
///
/// Using `OnceCell` to store a function’s previously computed value (a.k.a.
/// ‘lazy static’ or ‘memoizing’):
/// ‘lazy static’ or ‘memoizing’). Since [`drop`] is not called for static
/// items at the end of the program (see [the
/// reference](https://doc.rust-lang.org/reference/destructors.html), objects
/// stored using this pattern will not have their destructors called.
///
/// ```
/// use std::collections::HashMap;
Expand Down

0 comments on commit b79b687

Please sign in to comment.