Skip to content

Commit

Permalink
Rollup merge of rust-lang#135556 - AeonSolstice:patch-1, r=tgross35
Browse files Browse the repository at this point in the history
Clarify note in `std::sync::LazyLock` example

I doubt most people know what it means, as I did not until a week ago. In the current form, it seems like a `TODO:`.
  • Loading branch information
matthiaskrgr authored Jan 16, 2025
2 parents 2760486 + c4a5e12 commit b898de4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sync/lazy_lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ union Data<T, F> {
/// ```
/// use std::sync::LazyLock;
///
/// // n.b. static items do not call [`Drop`] on program termination, so this won't be deallocated.
/// // Note: static items do not call [`Drop`] on program termination, so this won't be deallocated.
/// // this is fine, as the OS can deallocate the terminated program faster than we can free memory
/// // but tools like valgrind might report "memory leaks" as it isn't obvious this is intentional.
/// static DEEP_THOUGHT: LazyLock<String> = LazyLock::new(|| {
Expand Down

0 comments on commit b898de4

Please sign in to comment.