diff --git a/.clippy.toml b/.clippy.toml deleted file mode 100644 index 1fdcf3e5ac..0000000000 --- a/.clippy.toml +++ /dev/null @@ -1 +0,0 @@ -large-error-threshold = 225 # bytes diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0561adeb80..ec707a12a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: env: RUST_BACKTRACE: 1 - RUST_VERSION: 1.65 + RUST_VERSION: 1.64 PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work RUSTFLAGS: --cfg=web_sys_unstable_apis -D warnings RUSTDOCFLAGS: -Dwarnings diff --git a/.github/workflows/cts.yml b/.github/workflows/cts.yml index 0c76a861da..332fc7fb6d 100644 --- a/.github/workflows/cts.yml +++ b/.github/workflows/cts.yml @@ -9,7 +9,7 @@ on: env: RUST_BACKTRACE: 1 - RUST_VERSION: 1.65 + RUST_VERSION: 1.64 jobs: cts: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a9bc5f0fd..586d0f79a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,7 @@ Bottom level categories: - Avoid panicking in some interactions with invalid resources by @nical in (#3094)[https://github.com/gfx-rs/wgpu/pull/3094] - Remove `wgpu_types::Features::DEPTH24PLUS_STENCIL8`, making `wgpu::TextureFormat::Depth24PlusStencil8` available on all backends. By @Healthire in (#3151)[https://github.com/gfx-rs/wgpu/pull/3151] - Fix an integer overflow in `queue_write_texture` by @nical in (#3146)[https://github.com/gfx-rs/wgpu/pull/3146] +- Make `RenderPassCompatibilityError` and `CreateShaderModuleError` not so huge. By @jimblandy in (#3226)[https://github.com/gfx-rs/wgpu/pull/3226] #### WebGPU @@ -107,7 +108,7 @@ Bottom level categories: ### Testing/Internal -- Update the `minimum supported rust version` to 1.65 +- Update the `minimum supported rust version` to 1.64 - Use cargo 1.64 workspace inheritance feature. By @jinleili in [#3107](https://github.com/gfx-rs/wgpu/pull/3107) #### Vulkan diff --git a/Cargo.toml b/Cargo.toml index 211736a5fa..1eb3768f0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ default-members = ["wgpu", "wgpu-hal", "wgpu-info"] [workspace.package] edition = "2021" -rust-version = "1.65" +rust-version = "1.64" keywords = ["graphics"] license = "MIT OR Apache-2.0" homepage = "https://wgpu.rs/" diff --git a/README.md b/README.md index 38d3847fd6..02aabc8258 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,27 @@ For an overview of all the components in the gfx-rs ecosystem, see [the big pict ### MSRV policy -Minimum Supported Rust Version is **1.65**. +Minimum Supported Rust Version is **1.64**. It is enforced on CI (in "/.github/workflows/ci.yml") with `RUST_VERSION` variable. This version can only be upgraded in breaking releases. +The `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates should never +require an MSRV ahead of Firefox's MSRV for nightly builds, as +determined by the value of `MINIMUM_RUST_VERSION` in +[`python/mozboot/mozboot/util.py`][util]. However, Firefox uses `cargo +vendor` to extract only those crates it actually uses, so the +workspace's other crates can have more recent MSRVs. + +*Note for Rust 1.64*: The workspace itself can even use a newer MSRV +than Firefox, as long as the vendoring step's `Cargo.toml` rewriting +removes any features Firefox's MSRV couldn't handle. For example, +`wgpu` can use manifest key inheritance, added in Rust 1.64, even +before Firefox reaches that MSRV, because `cargo vendor` copies +inherited values directly into the individual crates' `Cargo.toml` +files, producing 1.63-compatible files. + +[util]: https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py + ## Getting Started ### Rust diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 7a7e0be4c9..494fa41b7a 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -80,10 +80,7 @@ pub(crate) struct RenderPassContext { #[derive(Clone, Debug, Error)] pub enum RenderPassCompatibilityError { #[error("Incompatible color attachment: the renderpass expected {0:?} but was given {1:?}")] - IncompatibleColorAttachment( - ArrayVec, { hal::MAX_COLOR_ATTACHMENTS }>, - ArrayVec, { hal::MAX_COLOR_ATTACHMENTS }>, - ), + IncompatibleColorAttachment(Vec>, Vec>), #[error( "Incompatible depth-stencil attachment: the renderpass expected {0:?} but was given {1:?}" )] @@ -102,8 +99,8 @@ impl RenderPassContext { ) -> Result<(), RenderPassCompatibilityError> { if self.attachments.colors != other.attachments.colors { return Err(RenderPassCompatibilityError::IncompatibleColorAttachment( - self.attachments.colors.clone(), - other.attachments.colors.clone(), + self.attachments.colors.iter().cloned().collect(), + other.attachments.colors.iter().cloned().collect(), )); } if self.attachments.depth_stencil != other.attachments.depth_stencil { @@ -1245,7 +1242,7 @@ impl Device { pipeline::CreateShaderModuleError::Parsing(pipeline::ShaderError { source: code.to_string(), label: desc.label.as_ref().map(|l| l.to_string()), - inner, + inner: Box::new(inner), }) })?; (Cow::Owned(module), code.into_owned()) @@ -1308,7 +1305,7 @@ impl Device { pipeline::CreateShaderModuleError::Validation(pipeline::ShaderError { source, label: desc.label.as_ref().map(|l| l.to_string()), - inner, + inner: Box::new(inner), }) })?; let interface = diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 667b8b96ed..5c091e1d96 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -66,7 +66,7 @@ impl Resource for ShaderModule { pub struct ShaderError { pub source: String, pub label: Option, - pub inner: E, + pub inner: Box, } #[cfg(feature = "wgsl")] impl fmt::Display for ShaderError { diff --git a/wgpu-hal/Cargo.toml b/wgpu-hal/Cargo.toml index 79c5832219..aa8bbcada9 100644 --- a/wgpu-hal/Cargo.toml +++ b/wgpu-hal/Cargo.toml @@ -8,7 +8,12 @@ homepage.workspace = true repository.workspace = true keywords.workspace = true license.workspace = true -rust-version.workspace = true + +# Override the workspace's `rust-version` key. Firefox uses `cargo vendor` to +# 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.60" [package.metadata.docs.rs] # Ideally we would enable all the features.