Skip to content

Stabilize LazyCell and LazyLock#121377

Merged
bors merged 1 commit intorust-lang:masterfrom
pitaj:lazy_cell_fn_pointer
May 26, 2024
Merged

Stabilize LazyCell and LazyLock#121377
bors merged 1 commit intorust-lang:masterfrom
pitaj:lazy_cell_fn_pointer

Conversation

@pitaj
Copy link
Copy Markdown
Contributor

@pitaj pitaj commented Feb 21, 2024

Closes #109736

This stabilizes the LazyLock and LazyCell types:

static HASHMAP: LazyLock<HashMap<i32, String>> = LazyLock::new(|| {
    println!("initializing");
    let mut m = HashMap::new();
    m.insert(13, "Spica".to_string());
    m.insert(74, "Hoyten".to_string());
    m
});

let lazy: LazyCell<i32> = LazyCell::new(|| {
    println!("initializing");
    92
});

r? libs-api

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for lazy_cell