Skip to content

Reduce repo MSRV from 1.85 to 1.84 #7425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ env:
CI_BINARY_BUILD: "build20"

# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.85"
REPO_MSRV: "1.84"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.82.0"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.85"
REPO_MSRV: "1.84"

CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
#

# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.85"
REPO_MSRV: "1.84"
RUSTFLAGS: -D warnings

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ref_as_ptr = "warn"

[workspace.package]
edition = "2021"
rust-version = "1.85"
rust-version = "1.84"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ On Linux, you can point to them using `LD_LIBRARY_PATH` environment.
Due to complex dependants, we have two MSRV policies:

- `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.76**.
- The rest of the workspace has an MSRV of **1.85**.
- The rest of the workspace has an MSRV of **1.84**.

It is enforced on CI (in "/.github/workflows/ci.yml") with the `CORE_MSRV` and `REPO_MSRV` variables.
This version can only be upgraded in breaking releases, though we release a breaking version every three months.
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/01_hello_compute/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-01-hello-compute"
edition = "2021"
rust-version = "1.85"
rust-version = "1.84"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/02_hello_window/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-02-hello-window"
edition = "2021"
rust-version = "1.85"
rust-version = "1.84"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/custom_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-custom-backend"
edition = "2021"
rust-version = "1.85"
rust-version = "1.84"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion naga/xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "xtask"
version = "0.1.0"
edition = "2021"
publish = false
rust-version = "1.85"
rust-version = "1.84"

[dependencies]
anyhow = "1"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.85"
channel = "1.84"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
35 changes: 34 additions & 1 deletion wgpu/src/api/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Device {
use core::future::Future as _;
use core::pin::pin;
use core::task;
let ctx = &mut task::Context::from_waker(task::Waker::noop());
let ctx = &mut task::Context::from_waker(waker::noop_waker_ref());

let instance = Instance::new(&InstanceDescriptor {
backends: Backends::NOOP,
Expand Down Expand Up @@ -695,3 +695,36 @@ impl fmt::Display for Error {
}
}
}

// Copied from [`futures::task::noop_waker`].
// Needed until MSRV is 1.85 with `task::Waker::noop()` available
#[cfg(feature = "noop")]
mod waker {
use core::ptr::null;
use core::task::{RawWaker, RawWakerVTable, Waker};

unsafe fn noop_clone(_data: *const ()) -> RawWaker {
noop_raw_waker()
}

unsafe fn noop(_data: *const ()) {}

const NOOP_WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new(noop_clone, noop, noop, noop);

const fn noop_raw_waker() -> RawWaker {
RawWaker::new(null(), &NOOP_WAKER_VTABLE)
}

/// Get a static reference to a [`Waker`] which
/// does nothing when `wake()` is called on it.
#[inline]
pub fn noop_waker_ref() -> &'static Waker {
struct SyncRawWaker(RawWaker);
unsafe impl Sync for SyncRawWaker {}

static NOOP_WAKER_INSTANCE: SyncRawWaker = SyncRawWaker(noop_raw_waker());

// SAFETY: `Waker` is #[repr(transparent)] over its `RawWaker`.
unsafe { &*(&NOOP_WAKER_INSTANCE.0 as *const RawWaker as *const Waker) }
}
}
2 changes: 1 addition & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "xtask"
version = "0.1.0"
edition = "2021"
rust-version = "1.85"
rust-version = "1.84"
publish = false

[lints.rust]
Expand Down
Loading