Skip to content

Commit fdd9287

Browse files
authored
Unrolled build for rust-lang#127467
Rollup merge of rust-lang#127467 - GrigorenkoPV:bootstrap-once_cell, r=clubby789 bootstrap: once_cell::sync::Lazy -> std::sync::LazyLock Since rust-lang#121377 has landed on beta
2 parents cfd7cf5 + 8076a33 commit fdd9287

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/bootstrap/Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ dependencies = [
5454
"junction",
5555
"libc",
5656
"object",
57-
"once_cell",
5857
"opener",
5958
"pretty_assertions",
6059
"semver",

src/bootstrap/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ home = "0.5"
4949
ignore = "0.4"
5050
libc = "0.2"
5151
object = { version = "0.32", default-features = false, features = ["archive", "coff", "read_core", "unaligned"] }
52-
once_cell = "1.19"
5352
opener = "0.5"
5453
semver = "1.0"
5554
serde = "1.0"

src/bootstrap/src/core/builder.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::fs;
88
use std::hash::Hash;
99
use std::ops::Deref;
1010
use std::path::{Path, PathBuf};
11+
use std::sync::LazyLock;
1112
use std::time::{Duration, Instant};
1213

1314
use crate::core::build_steps::tool::{self, SourceType};
@@ -27,8 +28,6 @@ use crate::utils::exec::{command, BootstrapCommand};
2728
pub use crate::Compiler;
2829

2930
use clap::ValueEnum;
30-
// FIXME: replace with std::lazy after it gets stabilized and reaches beta
31-
use once_cell::sync::Lazy;
3231

3332
#[cfg(test)]
3433
mod tests;
@@ -498,7 +497,7 @@ impl StepDescription {
498497

499498
enum ReallyDefault<'a> {
500499
Bool(bool),
501-
Lazy(Lazy<bool, Box<dyn Fn() -> bool + 'a>>),
500+
Lazy(LazyLock<bool, Box<dyn Fn() -> bool + 'a>>),
502501
}
503502

504503
pub struct ShouldRun<'a> {
@@ -529,7 +528,7 @@ impl<'a> ShouldRun<'a> {
529528
}
530529

531530
pub fn lazy_default_condition(mut self, lazy_cond: Box<dyn Fn() -> bool + 'a>) -> Self {
532-
self.is_really_default = ReallyDefault::Lazy(Lazy::new(lazy_cond));
531+
self.is_really_default = ReallyDefault::Lazy(LazyLock::new(lazy_cond));
533532
self
534533
}
535534

src/bootstrap/src/utils/cache.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ use std::marker::PhantomData;
99
use std::mem;
1010
use std::ops::Deref;
1111
use std::path::PathBuf;
12-
use std::sync::Mutex;
13-
14-
// FIXME: replace with std::lazy after it gets stabilized and reaches beta
15-
use once_cell::sync::Lazy;
12+
use std::sync::{LazyLock, Mutex};
1613

1714
use crate::core::builder::Step;
1815

@@ -196,7 +193,7 @@ impl Interner {
196193
}
197194
}
198195

199-
pub static INTERNER: Lazy<Interner> = Lazy::new(Interner::default);
196+
pub static INTERNER: LazyLock<Interner> = LazyLock::new(Interner::default);
200197

201198
/// This is essentially a `HashMap` which allows storing any type in its input and
202199
/// any type in its output. It is a write-once cache; values are never evicted,

0 commit comments

Comments
 (0)