Skip to content
  1. Apr 16, 2021
  2. Apr 15, 2021
  3. Apr 14, 2021
    • Jim Blandy's avatar
      Avoid non-exhaustive matches on Expression. · 6701e2bf
      Jim Blandy authored
      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.
      6701e2bf
    • Dzmitry Malyshau's avatar
      Remove cargo-insta · c2c93e4e
      Dzmitry Malyshau authored
      c2c93e4e
    • Jim Blandy's avatar
      Makefile: Be more flexible in removing YAML headers from snapshots. · f7fdf6b5
      Jim Blandy authored
      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.
      f7fdf6b5
  4. Apr 13, 2021
  5. Apr 12, 2021
  6. Apr 11, 2021
  7. Apr 10, 2021
  8. Apr 09, 2021
  9. Apr 08, 2021
    • LaughingMan's avatar
      [spv-in] Copy less bytes in `parse_function` · d0d9e09c
      LaughingMan authored
      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.
      d0d9e09c
    • Dzmitry Malyshau's avatar
      [msl] inline some of the constants · 6166b95b
      Dzmitry Malyshau authored
      6166b95b