Move REPO_MSRV to 1.85 (#7218)

This commit is contained in:
Connor Fitzgerald 2025-02-24 23:39:34 -05:00 committed by GitHub
parent 6be5558865
commit 8fb09a5ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 49 additions and 48 deletions

View File

@ -36,7 +36,7 @@ env:
CI_BINARY_BUILD: "build20" CI_BINARY_BUILD: "build20"
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure. # This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.83" REPO_MSRV: "1.85"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates, # This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox. # to ensure that they can be used with firefox.
CORE_MSRV: "1.76" CORE_MSRV: "1.76"
@ -164,20 +164,9 @@ jobs:
tier: 2 tier: 2
kind: wgpu-only kind: wgpu-only
# TODO: Uncomment once web-sys updates past 0.3.76 - name: WebAssembly Core 1.0
# See https://github.com/rustwasm/wasm-bindgen/pull/4378 for details
# - name: WebAssembly Core 1.0
# os: ubuntu-22.04
# target: wasm32v1-none
# tier: 2
# kind: no_std
# Bare-metal x86-64
# TODO: Remove once web-sys updates past 0.3.76
# Included while wasm32v1-none is failing to ensure `no_std` does not regress
- name: no_std x86_64
os: ubuntu-22.04 os: ubuntu-22.04
target: x86_64-unknown-none target: wasm32v1-none
tier: 2 tier: 2
kind: no_std kind: no_std

View File

@ -3,14 +3,14 @@ name: Docs
on: on:
pull_request: pull_request:
paths: paths:
- '.github/workflows/docs.yml' - ".github/workflows/docs.yml"
push: push:
branches: branches:
- trunk - trunk
env: env:
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure. # This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.83" REPO_MSRV: "1.85"
CARGO_INCREMENTAL: false CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always

View File

@ -13,7 +13,7 @@ env:
# #
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure. # This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.83" REPO_MSRV: "1.85"
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings
jobs: jobs:
@ -36,10 +36,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# We can't rely on an override here, as that would only set
# the toolchain for the current directory, not the newly generated project.
- name: Install repo MSRV toolchain - name: Install repo MSRV toolchain
run: | run: |
rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal rustup toolchain install ${{ env.REPO_MSRV }} --no-self-update --profile=minimal
rustup override set ${{ env.REPO_MSRV }}
cargo -V cargo -V
- name: Disable debug symbols - name: Disable debug symbols
@ -74,4 +75,4 @@ jobs:
[patch.crates-io] [patch.crates-io]
wgpu = { path = "../wgpu/wgpu" } wgpu = { path = "../wgpu/wgpu" }
EOF EOF
cargo check cargo +${{ env.REPO_MSRV }} check

View File

@ -51,7 +51,7 @@ ref_as_ptr = "warn"
[workspace.package] [workspace.package]
edition = "2021" edition = "2021"
rust-version = "1.83" rust-version = "1.85"
keywords = ["graphics"] keywords = ["graphics"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/" homepage = "https://wgpu.rs/"

View File

@ -148,8 +148,8 @@ On Linux, you can point to them using `LD_LIBRARY_PATH` environment.
Due to complex dependants, we have two MSRV policies: Due to complex dependants, we have two MSRV policies:
- `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.76**, but may be lower than the rest of the workspace in the future. - `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.76**.
- The rest of the workspace has an MSRV of **1.83** as well right now, but may be higher than above listed crates. - The rest of the workspace has an MSRV of **1.85**.
It is enforced on CI (in "/.github/workflows/ci.yml") with the `CORE_MSRV` and `REPO_MSRV` variables. 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. This version can only be upgraded in breaking releases, though we release a breaking version every three months.

View File

@ -1,7 +1,7 @@
[package] [package]
name = "wgpu-example-01-hello-compute" name = "wgpu-example-01-hello-compute"
edition = "2021" edition = "2021"
rust-version = "1.83" rust-version = "1.85"
publish = false publish = false
[dependencies] [dependencies]

View File

@ -1,7 +1,7 @@
[package] [package]
name = "wgpu-example-02-hello-window" name = "wgpu-example-02-hello-window"
edition = "2021" edition = "2021"
rust-version = "1.83" rust-version = "1.85"
publish = false publish = false
[dependencies] [dependencies]

View File

@ -108,7 +108,7 @@ impl Instruction {
} }
pub(super) fn to_words(&self, sink: &mut impl Extend<Word>) { pub(super) fn to_words(&self, sink: &mut impl Extend<Word>) {
sink.extend(Some(self.wc << 16 | self.op as u32)); sink.extend(Some((self.wc << 16) | self.op as u32));
sink.extend(self.type_id); sink.extend(self.type_id);
sink.extend(self.result_id); sink.extend(self.result_id);
sink.extend(self.operands.iter().cloned()); sink.extend(self.operands.iter().cloned());

View File

@ -5572,7 +5572,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
8 => { 8 => {
inst.expect(5)?; inst.expect(5)?;
let high = self.next()?; let high = self.next()?;
crate::Literal::U64(u64::from(high) << 32 | u64::from(low)) crate::Literal::U64((u64::from(high) << 32) | u64::from(low))
} }
_ => return Err(Error::InvalidTypeWidth(width as u32)), _ => return Err(Error::InvalidTypeWidth(width as u32)),
} }
@ -5587,7 +5587,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
8 => { 8 => {
inst.expect(5)?; inst.expect(5)?;
let high = self.next()?; let high = self.next()?;
crate::Literal::I64((u64::from(high) << 32 | u64::from(low)) as i64) crate::Literal::I64(((u64::from(high) << 32) | u64::from(low)) as i64)
} }
_ => return Err(Error::InvalidTypeWidth(width as u32)), _ => return Err(Error::InvalidTypeWidth(width as u32)),
} }

View File

@ -3,7 +3,7 @@ name = "xtask"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
publish = false publish = false
rust-version = "1.83" rust-version = "1.85"
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"

View File

@ -1,4 +1,4 @@
[toolchain] [toolchain]
channel = "1.83" channel = "1.85"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"] targets = ["wasm32-unknown-unknown"]

View File

@ -250,12 +250,12 @@ impl FailureCase {
/// Returns true if the given failure "satisfies" this failure case. /// Returns true if the given failure "satisfies" this failure case.
pub(crate) fn matches_failure(&self, failure: &FailureResult) -> bool { pub(crate) fn matches_failure(&self, failure: &FailureResult) -> bool {
for reason in self.reasons() { for reason in self.reasons() {
let kind_matched = reason.kind.map_or(true, |kind| kind == failure.kind); let kind_matched = reason.kind.is_none_or(|kind| kind == failure.kind);
let message_matched = let message_matched =
reason reason
.message .message
.map_or(true, |message| matches!(&failure.message, Some(actual) if actual.to_lowercase().contains(&message.to_lowercase()))); .is_none_or(|message| matches!(&failure.message, Some(actual) if actual.to_lowercase().contains(&message.to_lowercase())));
if kind_matched && message_matched { if kind_matched && message_matched {
let message = failure.message.as_deref().unwrap_or("*no message*"); let message = failure.message.as_deref().unwrap_or("*no message*");

View File

@ -261,8 +261,7 @@ impl Global {
Some(size) => size, Some(size) => size,
}; };
let scratch_buffer = let scratch_buffer = ScratchBuffer::new(device, scratch_size)?;
ScratchBuffer::new(device, scratch_size).map_err(crate::device::DeviceError::from)?;
let scratch_buffer_barrier = hal::BufferBarrier::<dyn hal::DynBuffer> { let scratch_buffer_barrier = hal::BufferBarrier::<dyn hal::DynBuffer> {
buffer: scratch_buffer.raw(), buffer: scratch_buffer.raw(),
@ -583,8 +582,7 @@ impl Global {
Some(size) => size, Some(size) => size,
}; };
let scratch_buffer = let scratch_buffer = ScratchBuffer::new(device, scratch_size)?;
ScratchBuffer::new(device, scratch_size).map_err(crate::device::DeviceError::from)?;
let scratch_buffer_barrier = hal::BufferBarrier::<dyn hal::DynBuffer> { let scratch_buffer_barrier = hal::BufferBarrier::<dyn hal::DynBuffer> {
buffer: scratch_buffer.raw(), buffer: scratch_buffer.raw(),
@ -645,8 +643,7 @@ impl Global {
let mut staging_buffer = StagingBuffer::new( let mut staging_buffer = StagingBuffer::new(
device, device,
wgt::BufferSize::new(instance_buffer_staging_source.len() as u64).unwrap(), wgt::BufferSize::new(instance_buffer_staging_source.len() as u64).unwrap(),
) )?;
.map_err(crate::device::DeviceError::from)?;
staging_buffer.write(&instance_buffer_staging_source); staging_buffer.write(&instance_buffer_staging_source);
let flushed = staging_buffer.flush(); let flushed = staging_buffer.flush();
Some(flushed) Some(flushed)

View File

@ -35,7 +35,9 @@ targets = [
ignored = ["cfg_aliases"] ignored = ["cfg_aliases"]
[lints.rust] [lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(web_sys_unstable_apis)'] } unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(web_sys_unstable_apis)', # web-sys uses this
] }
[lib] [lib]
@ -174,6 +176,14 @@ device_lost_panic = []
# Only affects the d3d12 and vulkan backends. # Only affects the d3d12 and vulkan backends.
internal_error_panic = [] internal_error_panic = []
###################
### Workarounds ###
###################
# objc's `msg_send` macro injects this in our code https://github.com/SSheldon/rust-objc/issues/125
# You shouldn't ever enable this feature.
cargo-clippy = []
[[example]] [[example]]
name = "halmark" name = "halmark"

View File

@ -677,10 +677,11 @@ impl crate::Device for super::Device {
None => Direct3D12::D3D12_FILTER_REDUCTION_TYPE_STANDARD, None => Direct3D12::D3D12_FILTER_REDUCTION_TYPE_STANDARD,
}; };
let mut filter = Direct3D12::D3D12_FILTER( let mut filter = Direct3D12::D3D12_FILTER(
conv::map_filter_mode(desc.min_filter).0 << Direct3D12::D3D12_MIN_FILTER_SHIFT (conv::map_filter_mode(desc.min_filter).0 << Direct3D12::D3D12_MIN_FILTER_SHIFT)
| conv::map_filter_mode(desc.mag_filter).0 << Direct3D12::D3D12_MAG_FILTER_SHIFT | (conv::map_filter_mode(desc.mag_filter).0 << Direct3D12::D3D12_MAG_FILTER_SHIFT)
| conv::map_filter_mode(desc.mipmap_filter).0 << Direct3D12::D3D12_MIP_FILTER_SHIFT | (conv::map_filter_mode(desc.mipmap_filter).0
| reduction.0 << Direct3D12::D3D12_FILTER_REDUCTION_TYPE_SHIFT, << Direct3D12::D3D12_MIP_FILTER_SHIFT)
| (reduction.0 << Direct3D12::D3D12_FILTER_REDUCTION_TYPE_SHIFT),
); );
if desc.anisotropy_clamp != 1 { if desc.anisotropy_clamp != 1 {

View File

@ -2064,10 +2064,7 @@ impl crate::Device for super::Device {
let vk_dynamic_state = let vk_dynamic_state =
vk::PipelineDynamicStateCreateInfo::default().dynamic_states(&dynamic_states); vk::PipelineDynamicStateCreateInfo::default().dynamic_states(&dynamic_states);
let raw_pass = self let raw_pass = self.shared.make_render_pass(compatible_rp_key)?;
.shared
.make_render_pass(compatible_rp_key)
.map_err(crate::DeviceError::from)?;
let vk_infos = [{ let vk_infos = [{
vk::GraphicsPipelineCreateInfo::default() vk::GraphicsPipelineCreateInfo::default()

View File

@ -803,7 +803,7 @@ fn check_buffer_bounds(
if let Some(size) = size { if let Some(size) = size {
// Detect integer overflow. // Detect integer overflow.
let end = offset.checked_add(size.get()); let end = offset.checked_add(size.get());
if end.map_or(true, |end| end > buffer_size) { if end.is_none_or(|end| end > buffer_size) {
panic!( panic!(
"slice offset {} size {} is out of range for buffer of size {}", "slice offset {} size {} is out of range for buffer of size {}",
offset, size, buffer_size offset, size, buffer_size

View File

@ -2,9 +2,15 @@
name = "xtask" name = "xtask"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
rust-version = "1.83" rust-version = "1.85"
publish = false publish = false
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
# Added by xshell
'cfg(trick_rust_analyzer_into_highlighting_interpolated_bits)',
] }
[dependencies] [dependencies]
# The dependencies in this config have no transitive dependencies. # The dependencies in this config have no transitive dependencies.
anyhow = "1.0.71" anyhow = "1.0.71"