Skip to content

Commit 517e50a

Browse files
chore: update CORE_MSRV to 1.90
New cases for some Clippy lints pop up as part of this upgrade that cannot be done before, listed below. Yuck! - `clippy::manual_is_multiple_of` - `clippy::missing_const_for_fn` - `clippy::useless_nonzero_new_unchecked`
1 parent d0c9044 commit 517e50a

71 files changed

Lines changed: 95 additions & 132 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
REPO_MSRV: "1.92"
2323
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
2424
# to ensure that they can be used with firefox.
25-
CORE_MSRV: "1.82.0"
25+
CORE_MSRV: "1.90.0"
2626

2727
#
2828
# Environment variables

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ Bottom level categories:
4848
- Added support for no-perspective barycentric coordinates. By @atlv24 in [#8852](https://github.com/gfx-rs/wgpu/issues/8852).
4949
- Added support for obtaining `AdapterInfo` from `Device`. By @sagudev in [#8807](https://github.com/gfx-rs/wgpu/pull/8807).
5050
- Added `Limits::or_worse_values_from`. By @atlv24 in [#8870](https://github.com/gfx-rs/wgpu/pull/8870).
51+
- Made the following available in `const` contexts:
52+
- `naga`
53+
- `Arena::len`
54+
- `Arena::is_empty`
55+
- `Range::first_and_last`
56+
- `front::wgsl::Frontend::set_options`
57+
- `ir::Block::is_empty`
58+
- `ir::Block::len`
5159

5260
#### Naga
5361

naga-cli/src/bin/naga.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(clippy::manual_strip)]
21
use anyhow::{anyhow, Context as _};
3-
#[allow(unused_imports)]
42
use std::fs;
53
use std::{error::Error, fmt, io::Read, path::Path, str::FromStr};
64

@@ -260,10 +258,10 @@ impl FromStr for GlslProfileArg {
260258

261259
fn from_str(s: &str) -> Result<Self, Self::Err> {
262260
use naga::back::glsl::Version;
263-
Ok(Self(if s.starts_with("core") {
264-
Version::Desktop(s[4..].parse().unwrap_or(330))
265-
} else if s.starts_with("es") {
266-
Version::new_gles(s[2..].parse().unwrap_or(310))
261+
Ok(Self(if let Some(s) = s.strip_prefix("core") {
262+
Version::Desktop(s.parse().unwrap_or(330))
263+
} else if let Some(s) = s.strip_prefix("es") {
264+
Version::new_gles(s.parse().unwrap_or(310))
267265
} else {
268266
return Err(format!("Unknown profile: {s}"));
269267
}))

naga/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude = ["bin/**/*", "tests/**/*", "Cargo.lock", "target/**/*"]
1313
# copy the crates it actually uses out of the workspace, so it's meaningful for
1414
# them to have less restrictive MSRVs individually than the workspace as a
1515
# whole, if their code permits. See `../README.md` for details.
16-
rust-version = "1.82.0"
16+
rust-version = "1.90.0"
1717

1818
[package.metadata.docs.rs]
1919
all-features = true

naga/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Crates.io](https://img.shields.io/crates/v/naga.svg?label=naga)](https://crates.io/crates/naga)
55
[![Docs.rs](https://docs.rs/naga/badge.svg)](https://docs.rs/naga)
66
[![Build Status](https://github.com/gfx-rs/naga/workflows/pipeline/badge.svg)](https://github.com/gfx-rs/naga/actions)
7-
![MSRV](https://img.shields.io/badge/rustc-1.82-blue.svg)
7+
![MSRV](https://img.shields.io/badge/rustc-1.90-blue.svg)
88
[![codecov.io](https://codecov.io/gh/gfx-rs/naga/branch/master/graph/badge.svg?token=9VOKYO8BM2)](https://codecov.io/gh/gfx-rs/naga)
99

1010
The shader translation library for the needs of [wgpu](https://github.com/gfx-rs/wgpu).

naga/src/arena/handlevec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<T, U> HandleVec<T, U> {
5050
}
5151
}
5252

53-
pub(crate) fn len(&self) -> usize {
53+
pub(crate) const fn len(&self) -> usize {
5454
self.inner.len()
5555
}
5656

naga/src/arena/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,17 @@ impl<T> Arena<T> {
7878
}
7979

8080
/// Extracts the inner vector.
81-
#[allow(clippy::missing_const_for_fn)] // ignore due to requirement of #![feature(const_precise_live_drops)]
8281
pub fn into_inner(self) -> Vec<T> {
8382
self.data
8483
}
8584

8685
/// Returns the current number of items stored in this arena.
87-
pub fn len(&self) -> usize {
86+
pub const fn len(&self) -> usize {
8887
self.data.len()
8988
}
9089

9190
/// Returns `true` if the arena contains no elements.
92-
pub fn is_empty(&self) -> bool {
91+
pub const fn is_empty(&self) -> bool {
9392
self.data.is_empty()
9493
}
9594

naga/src/arena/range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<T> Range<T> {
106106
///
107107
/// If `self` is an empty range, there are no handles included, so
108108
/// return `None`.
109-
pub fn first_and_last(&self) -> Option<(Handle<T>, Handle<T>)> {
109+
pub const fn first_and_last(&self) -> Option<(Handle<T>, Handle<T>)> {
110110
if self.inner.start < self.inner.end {
111111
Some((
112112
// `Range::new_from_bounds` expects a start- and end-inclusive

naga/src/back/glsl/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl FeaturesManager {
7878
}
7979

8080
/// Checks if the list of features [`Features`] contains the specified [`Features`]
81-
pub fn contains(&mut self, features: Features) -> bool {
81+
pub const fn contains(&mut self, features: Features) -> bool {
8282
self.0.contains(features)
8383
}
8484

naga/src/back/glsl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ struct IdGenerator(u32);
454454

455455
impl IdGenerator {
456456
/// Generates a number that's guaranteed to be unique for this `IdGenerator`
457-
fn generate(&mut self) -> u32 {
457+
const fn generate(&mut self) -> u32 {
458458
// It's just an increasing number but it does the job
459459
let ret = self.0;
460460
self.0 += 1;

0 commit comments

Comments
 (0)