Non-exhaustive matches on `Expression` make it harder to review changes that add
new enum variants, because the compiler can't tell you that you've missed a
case.
Although I believe Clippy is able to do so, I don't think we should make a
blanket rule of forbidding wildcard match arms against `Expression`. There are a
few matches that are only concerned with a handful of variants, or a single
variant. For example, variant, naga::front::spv::Parser::next_block is only
concerned with whether an expression is a constant or not. In principle, these
sites should also be checked when adding a new variant, but it seems too
burdensome to require them to list all the `Expression` variants they don't care
about. The principle should be applied only to matches that are already handling
most variants.
At the moment, there is only one such match on `Expression` in the code base,
and it's only missing a few variants, so this is quick to fix.
The snapshot files in tests/out start with headers like this:
---
source: tests/snapshots.rs
expression: dis
---
; SPIR-V
; Version: 1.0
; Generator: rspirv
...
The Makefile's `validate-foo` targets trim off those lines with `tail -n +5`
before submitting their test to the validators.
However, some versions of the `insta` crate seem to generate headers with an
extra blank line, like this:
---
source: tests/snapshots.rs
expression: dis
---
This makes the `validate-foo` targets unhappy.
This commit changes the `validate-foo` targets to use `sed` to cope with both
kinds of headers.
855: Remove comment about `Vec::remove_item` r=kvark a=Pat-Lafon
Sadly, `Vec::remove_item` was an unstable method that was deprecated and has now been removed.
https://github.com/rust-lang/rust/pull/80972
This pr removes a comment suggesting to use `Vec::remove_item` when it stabilizes.
Co-authored-by: Patrick LaFontaine <32135464+Pat-Lafon@users.noreply.github.com>
1320: Update naga to gfx-21 r=kvark a=kvark
**Connections**
See https://github.com/gfx-rs/gfx/pull/3720
**Description**
Brings a number of Naga fixes.
**Testing**
wgpu-rs examples
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
1313: Don't panic on change_extend errors r=cwfitzgerald a=kvark
**Connections**
???
**Description**
We used to have leftover `unwrap()` for extending the usages of render targets.
Now these are all routed via `UsageConflicts` into actual errors.
**Testing**
Untested
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
847: Don't pin web-sys and wasm-bindgen versions r=grovesNL a=RichoDemus
Pinning them forces all downstream dependencies to use exactly this version
The latest release of wgpu has pinned an old version of wasm-bindgen, forcing users to downgrade wasm-bindgen-cli in order to build
Co-authored-by: Richard Tjerngren <git@richodemus.com>
Co-authored-by: RichoDemus <git@richodemus.com>
The initial intention was to make the code a little more elegant and match on
the Vec itself instead of its length, however there's also a - probably
minuscule - performance advantage:
`Vec::remove` internally copies the removed element onto the stack. In this case
that's a `StructMember` weighting 48 bytes. The `Binding` we are actually
interested in is only 8 bytes tough.
Cloning just the `Binding` saves us from copying 40 bytes for nothing.