Skip to content

Commit e1c2aad

Browse files
bors[bot]cuviper
andauthored
1027: Use const-TLS for the `WorkerThread` pointer (MSRV 1.59) r=cuviper a=cuviper This enables more efficient code -- stabilized in rust-lang/rust#91355. Co-authored-by: Josh Stone <cuviper@gmail.com>
2 parents 1341ce3 + 34acd66 commit e1c2aad

File tree

10 files changed

+16
-12
lines changed

10 files changed

+16
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
jobs:
99

1010
check:
11-
name: Check (1.56.0)
11+
name: Check (1.59.0)
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
- uses: dtolnay/rust-toolchain@1.56.0
15+
- uses: dtolnay/rust-toolchain@1.59.0
1616
- run: cp ci/compat-Cargo.lock ./Cargo.lock
1717
- run: cargo check --verbose --locked
1818

.github/workflows/pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ env:
88
jobs:
99

1010
check:
11-
name: Check (1.56.0)
11+
name: Check (1.59.0)
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15-
- uses: dtolnay/rust-toolchain@1.56.0
15+
- uses: dtolnay/rust-toolchain@1.59.0
1616
- run: cp ci/compat-Cargo.lock ./Cargo.lock
1717
- run: cargo check --verbose --locked
1818

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "1.6.1"
44
authors = ["Niko Matsakis <niko@alum.mit.edu>",
55
"Josh Stone <cuviper@gmail.com>"]
66
description = "Simple work-stealing parallelism for Rust"
7-
rust-version = "1.56"
7+
rust-version = "1.59"
88
edition = "2021"
99
license = "MIT OR Apache-2.0"
1010
repository = "https://github.com/rayon-rs/rayon"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Rayon crate](https://img.shields.io/crates/v/rayon.svg)](https://crates.io/crates/rayon)
44
[![Rayon documentation](https://docs.rs/rayon/badge.svg)](https://docs.rs/rayon)
5-
![minimum rustc 1.56](https://img.shields.io/badge/rustc-1.56+-red.svg)
5+
![minimum rustc 1.59](https://img.shields.io/badge/rustc-1.59+-red.svg)
66
[![build status](https://github.com/rayon-rs/rayon/workflows/master/badge.svg)](https://github.com/rayon-rs/rayon/actions)
77
[![Join the chat at https://gitter.im/rayon-rs/Lobby](https://badges.gitter.im/rayon-rs/Lobby.svg)](https://gitter.im/rayon-rs/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
88

@@ -84,7 +84,7 @@ just add:
8484
use rayon::prelude::*;
8585
```
8686

87-
Rayon currently requires `rustc 1.56.0` or greater.
87+
Rayon currently requires `rustc 1.59.0` or greater.
8888

8989
### Usage with WebAssembly
9090

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
3+
- The minimum supported `rustc` is now 1.59.
4+
15
# Release rayon-core 1.10.2 (2023-01-22)
26

37
- Fixed miri-reported UB for SharedReadOnly tags protected by a call.

bors.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
status = [
2-
"Check (1.56.0)",
2+
"Check (1.59.0)",
33
"Test (ubuntu-latest, stable)",
44
"Test (ubuntu-latest, stable-i686)",
55
"Test (ubuntu-latest, beta)",

rayon-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description = "Core APIs for Rayon"
77
license = "MIT OR Apache-2.0"
88
repository = "https://github.com/rayon-rs/rayon"
99
documentation = "https://docs.rs/rayon/"
10-
rust-version = "1.56"
10+
rust-version = "1.59"
1111
edition = "2021"
1212
links = "rayon-core"
1313
build = "build.rs"

rayon-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Please see [Rayon Docs] for details about using Rayon.
88

99
[Rayon Docs]: https://docs.rs/rayon/
1010

11-
Rayon-core currently requires `rustc 1.56.0` or greater.
11+
Rayon-core currently requires `rustc 1.59.0` or greater.

rayon-core/src/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ pub(super) struct WorkerThread {
686686
// worker is fully unwound. Using an unsafe pointer avoids the need
687687
// for a RefCell<T> etc.
688688
thread_local! {
689-
static WORKER_THREAD_STATE: Cell<*const WorkerThread> = Cell::new(ptr::null());
689+
static WORKER_THREAD_STATE: Cell<*const WorkerThread> = const { Cell::new(ptr::null()) };
690690
}
691691

692692
impl From<ThreadBuilder> for WorkerThread {

rayon-demo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
rust-version = "1.56"
2+
rust-version = "1.59"
33
edition = "2021"
44
name = "rayon-demo"
55
version = "0.0.0"

0 commit comments

Comments
 (0)