Skip to content
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

Raise MSRV to Rust 1.80 #6105

Draft
wants to merge 10 commits into
base: trunk
Choose a base branch
from
Draft
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ env:
# We sometimes need nightly to use special things in CI.
#
# In order to prevent CI regressions, we pin the nightly version.
NIGHTLY_VERSION: "nightly-2023-12-17"
NIGHTLY_VERSION: "nightly-2024-08-11"
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.76"
REPO_MSRV: "1.80.1"
# 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.76"
CORE_MSRV: "1.80.1"

#
# Environment variables
Expand Down
20 changes: 13 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ default-members = [

[workspace.package]
edition = "2021"
rust-version = "1.76"
rust-version = "1.80.1"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
Expand Down Expand Up @@ -77,7 +77,7 @@ bincode = "1"
bit-vec = "0.8"
bitflags = "2.6"
bytemuck = { version = "1.18", features = ["derive"] }
cfg_aliases = "0.1"
cfg_aliases = "0.2.1"
cfg-if = "1"
criterion = "0.5"
codespan-reporting = "0.11"
Expand Down
3 changes: 3 additions & 0 deletions benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ path = "benches/root.rs"
# tracy = ["dep:tracy-client", "profiling/profile-with-tracy"]
# superluminal = ["profiling/profile-with-superluminal"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("tracy"))'] }

[dependencies]
bincode.workspace = true
bytemuck.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion examples/src/boids/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// adapted from https://github.com/austinEng/webgpu-samples/blob/master/src/examples/computeBoids.ts

use nanorand::{Rng, WyRand};
use std::{borrow::Cow, mem::size_of};
use std::borrow::Cow;
use wgpu::util::DeviceExt;

// number of boid particles to simulate
Expand Down
2 changes: 1 addition & 1 deletion examples/src/cube/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::{borrow::Cow, f32::consts, mem::size_of};
use std::{borrow::Cow, f32::consts};
use wgpu::util::DeviceExt;

#[repr(C)]
Expand Down
2 changes: 1 addition & 1 deletion examples/src/hello_compute/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, mem::size_of_val, str::FromStr};
use std::{borrow::Cow, str::FromStr};
use wgpu::util::DeviceExt;

// Indicates a u32 overflow in an intermediate Collatz value
Expand Down
2 changes: 0 additions & 2 deletions examples/src/hello_synchronization/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::mem::size_of_val;

const ARR_SIZE: usize = 128;

struct ExecuteResults {
Expand Down
2 changes: 0 additions & 2 deletions examples/src/hello_workgroups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//!
//! Only parts specific to this example will be commented.

use std::mem::size_of_val;

use wgpu::util::DeviceExt;

async fn run() {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/mipmap/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::{borrow::Cow, f32::consts, mem::size_of};
use std::{borrow::Cow, f32::consts};
use wgpu::util::DeviceExt;

const TEXTURE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8UnormSrgb;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/msaa_line/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! * Set the primitive_topology to PrimitiveTopology::LineList.
//! * Vertices and Indices describe the two points that make up a line.

use std::{borrow::Cow, iter, mem::size_of};
use std::{borrow::Cow, iter};

use bytemuck::{Pod, Zeroable};
use wgpu::util::DeviceExt;
Expand Down
2 changes: 0 additions & 2 deletions examples/src/repeated_compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
//! hello-compute example does not such as mapping buffers
//! and why use the async channels.

use std::mem::size_of_val;

const OVERFLOW: u32 = 0xffffffff;

async fn run() {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/shadow/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, f32::consts, iter, mem::size_of, ops::Range, sync::Arc};
use std::{borrow::Cow, f32::consts, iter, ops::Range, sync::Arc};

use bytemuck::{Pod, Zeroable};
use wgpu::util::{align_to, DeviceExt};
Expand Down
2 changes: 1 addition & 1 deletion examples/src/skybox/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::{borrow::Cow, f32::consts, mem::size_of};
use std::{borrow::Cow, f32::consts};
use wgpu::{util::DeviceExt, AstcBlock, AstcChannel};

const IMAGE_SIZE: u32 = 256;
Expand Down
1 change: 0 additions & 1 deletion examples/src/stencil_triangles/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::borrow::Cow;
use std::mem::size_of;
use wgpu::util::DeviceExt;

#[repr(C)]
Expand Down
2 changes: 0 additions & 2 deletions examples/src/storage_texture/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
//! A lot of things aren't explained here via comments. See hello-compute and
//! repeated-compute for code that is more thoroughly commented.

use std::mem::size_of_val;

#[cfg(not(target_arch = "wasm32"))]
use crate::utils::output_image_native;
#[cfg(target_arch = "wasm32")]
Expand Down
5 changes: 1 addition & 4 deletions examples/src/texture_arrays/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::{
mem::size_of,
num::{NonZeroU32, NonZeroU64},
};
use std::num::{NonZeroU32, NonZeroU64};
use wgpu::util::DeviceExt;

#[repr(C)]
Expand Down
2 changes: 0 additions & 2 deletions examples/src/timestamp_queries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
//! The period, i.e. the unit of time, of the timestamps in wgpu is undetermined and needs to be queried with `wgpu::Queue::get_timestamp_period`
//! in order to get comparable results.

use std::mem::size_of;

use wgpu::util::DeviceExt;

struct Queries {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/uniform_values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! The usage of the uniform buffer within the shader itself is pretty self-explanatory given
//! some understanding of WGSL.

use std::{mem::size_of, sync::Arc};
use std::sync::Arc;
// We won't bring StorageBuffer into scope as that might be too easy to confuse
// with actual GPU-allocated WGPU storage buffers.
use encase::ShaderType;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/water/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod point_gen;
use bytemuck::{Pod, Zeroable};
use glam::Vec3;
use nanorand::{Rng, WyRand};
use std::{borrow::Cow, f32::consts, iter, mem::size_of};
use std::{borrow::Cow, f32::consts, iter};
use wgpu::util::DeviceExt;

///
Expand Down
2 changes: 1 addition & 1 deletion naga/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ autotests = false
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.76"
rust-version = "1.80.0"

[[test]]
name = "naga-test"
Expand Down
1 change: 0 additions & 1 deletion naga/src/back/msl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,5 @@ pub fn write_string(

#[test]
fn test_error_size() {
use std::mem::size_of;
assert_eq!(size_of::<Error>(), 32);
}
2 changes: 1 addition & 1 deletion naga/src/front/spv/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ impl Error {

impl From<atomic_upgrade::Error> for Error {
fn from(source: atomic_upgrade::Error) -> Self {
crate::front::spv::Error::AtomicUpgradeError(source)
Error::AtomicUpgradeError(source)
}
}
1 change: 0 additions & 1 deletion player/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use player::GlobalPlay;
use std::{
fs::{read_to_string, File},
io::{Read, Seek, SeekFrom},
mem::size_of,
path::{Path, PathBuf},
slice,
};
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.76"
channel = "1.80.1"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]
2 changes: 1 addition & 1 deletion tests/tests/compute_pass_ownership.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Tests that compute passes take ownership of resources that are associated with.
//! I.e. once a resource is passed in to a compute pass, it can be dropped.

use std::{mem::size_of, num::NonZeroU64};
use std::num::NonZeroU64;

use wgpu::util::DeviceExt as _;
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/occlusion_query/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, mem::size_of};
use std::borrow::Cow;
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration, TestParameters};

#[gpu_test]
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/render_pass_ownership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! * rpass.multi_draw_indirect_count
//! * rpass.multi_draw_indexed_indirect_count
//!
use std::{mem::size_of, num::NonZeroU64};
use std::num::NonZeroU64;

use wgpu::util::DeviceExt as _;
use wgpu_test::{gpu_test, valid, GpuTestConfiguration, TestParameters, TestingContext};
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/subgroup_operations/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{borrow::Cow, mem::size_of, num::NonZeroU64};
use std::{borrow::Cow, num::NonZeroU64};

use wgpu_test::{gpu_test, GpuTestConfiguration, TestParameters};

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/vertex_formats/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Tests that vertex formats pass through to vertex shaders accurately.

use std::{mem::size_of_val, num::NonZeroU64};
use std::num::NonZeroU64;

use wgpu::util::{BufferInitDescriptor, DeviceExt};

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/vertex_indices/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! We need tests for these as the backends use various schemes to work around the lack
//! of support for things like `gl_BaseInstance` in shaders.

use std::{mem::size_of_val, num::NonZeroU64, ops::Range};
use std::{num::NonZeroU64, ops::Range};

use itertools::Itertools;
use strum::IntoEnumIterator;
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0"
# copy the crates it actually uses out of the workspace, so it's meaningful for
# them to have less restrictive MSRVs individually than the workspace as a
# whole, if their code permits. See `../README.md` for details.
rust-version = "1.76"
rust-version = "1.80.0"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 2 additions & 0 deletions wgpu-core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ fn main() {
metal: { all(any(target_os = "ios", target_os = "macos"), feature = "metal") },
vulkan: { all(not(target_arch = "wasm32"), feature = "vulkan") }
}
println!("cargo::rustc-check-cfg=cfg(wgpu_core_doc)");
println!("cargo::rustc-check-cfg=cfg(wgpu_validate_locks)");
}
2 changes: 1 addition & 1 deletion wgpu-core/src/command/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ use crate::{
};
use arrayvec::ArrayVec;

use std::{borrow::Cow, mem::size_of, num::NonZeroU32, ops::Range, sync::Arc};
use std::{borrow::Cow, num::NonZeroU32, ops::Range, sync::Arc};
use thiserror::Error;

use super::{
Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/command/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use thiserror::Error;
use wgt::{BufferAddress, DynamicOffset};

use std::sync::Arc;
use std::{fmt, mem::size_of, str};
use std::{fmt, str};

use super::{bind::BinderError, memory_init::CommandBufferTextureMemoryActions};

Expand Down
2 changes: 1 addition & 1 deletion wgpu-core/src/command/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use serde::Deserialize;
use serde::Serialize;

use std::sync::Arc;
use std::{borrow::Cow, fmt, iter, mem::size_of, num::NonZeroU32, ops::Range, str};
use std::{borrow::Cow, fmt, iter, num::NonZeroU32, ops::Range, str};

use super::render_command::ArcRenderCommand;
use super::{
Expand Down
1 change: 0 additions & 1 deletion wgpu-core/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::{
fmt::{self, Debug},
hash::Hash,
marker::PhantomData,
mem::size_of,
num::NonZeroU64,
};
use wgt::WasmNotSendSync;
Expand Down
1 change: 1 addition & 0 deletions wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
)]
#![warn(
clippy::ptr_as_ptr,
clippy::ref_as_ptr,
trivial_casts,
trivial_numeric_casts,
unsafe_op_in_unsafe_fn,
Expand Down
2 changes: 0 additions & 2 deletions wgpu-core/src/pipeline_cache.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::mem::size_of;

use thiserror::Error;
use wgt::AdapterInfo;

Expand Down
Loading
Loading