diff --git a/crossbeam-channel/benchmarks/flume.rs b/crossbeam-channel/benchmarks/flume.rs index 06b942105..507942a17 100644 --- a/crossbeam-channel/benchmarks/flume.rs +++ b/crossbeam-channel/benchmarks/flume.rs @@ -13,7 +13,7 @@ pub fn shuffle(v: &mut [T]) { } thread_local! { - static RNG: Cell> = Cell::new(Wrapping(1)); + static RNG: Cell> = const { Cell::new(Wrapping(1)) }; } RNG.with(|rng| { diff --git a/crossbeam-channel/benchmarks/mpsc.rs b/crossbeam-channel/benchmarks/mpsc.rs index 728fdd39a..9c69c257e 100644 --- a/crossbeam-channel/benchmarks/mpsc.rs +++ b/crossbeam-channel/benchmarks/mpsc.rs @@ -15,7 +15,7 @@ pub fn shuffle(v: &mut [T]) { } thread_local! { - static RNG: Cell> = Cell::new(Wrapping(1)); + static RNG: Cell> = const { Cell::new(Wrapping(1)) }; } RNG.with(|rng| { diff --git a/crossbeam-channel/src/utils.rs b/crossbeam-channel/src/utils.rs index f623f2708..705ca1a2d 100644 --- a/crossbeam-channel/src/utils.rs +++ b/crossbeam-channel/src/utils.rs @@ -13,7 +13,7 @@ pub(crate) fn shuffle(v: &mut [T]) { } thread_local! { - static RNG: Cell> = Cell::new(Wrapping(1_406_868_647)); + static RNG: Cell> = const { Cell::new(Wrapping(1_406_868_647)) }; } let _ = RNG.try_with(|rng| { diff --git a/crossbeam-channel/tests/thread_locals.rs b/crossbeam-channel/tests/thread_locals.rs index fb4e577f2..4639833aa 100644 --- a/crossbeam-channel/tests/thread_locals.rs +++ b/crossbeam-channel/tests/thread_locals.rs @@ -30,7 +30,7 @@ fn use_while_exiting() { } thread_local! { - static FOO: Foo = Foo; + static FOO: Foo = const { Foo }; } let (s, r) = unbounded::<()>(); diff --git a/crossbeam-epoch/src/default.rs b/crossbeam-epoch/src/default.rs index b42c1c7a7..a9790a373 100644 --- a/crossbeam-epoch/src/default.rs +++ b/crossbeam-epoch/src/default.rs @@ -77,7 +77,7 @@ mod tests { } thread_local! { - static FOO: Foo = Foo; + static FOO: Foo = const { Foo }; } thread::scope(|scope| {