diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-25 22:15:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-25 22:15:16 +0200 |
| commit | 890982e47bf3dea0f3625aabddf9312d89b81972 (patch) | |
| tree | 8d381a5df522b067589c156ff5e03bff184ca2fe /compiler/rustc_interface/src | |
| parent | 48f00110d0dae38b3046a9ac05d20ea321fd6637 (diff) | |
| parent | 4913ab8f779582dc9da099a148a4670ede0e15aa (diff) | |
Rollup merge of #121377 - pitaj:lazy_cell_fn_pointer, r=dtolnay
Stabilize `LazyCell` and `LazyLock`
Closes #109736
This stabilizes the [`LazyLock`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html) and [`LazyCell`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html) types:
```rust
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
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/lib.rs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/lib.rs b/compiler/rustc_interface/src/lib.rs index c1d460ddd08..8b1d9b706ca 100644 --- a/compiler/rustc_interface/src/lib.rs +++ b/compiler/rustc_interface/src/lib.rs @@ -1,5 +1,4 @@ #![feature(decl_macro)] -#![feature(lazy_cell)] #![feature(let_chains)] #![feature(thread_spawn_unchecked)] #![feature(try_blocks)] |
