git.delta.rocks / jrsonnet / refs/commits / c5b983e11d4d

difftreelog

ci bump Rust version and resolve clippy issues (#160)

Petr Portnov | PROgrm_JARvis2024-05-10parent: #ad68a24.patch.diff
in: master
* build: bump Rust version and update dependencies

* chore: resolve all reported Clippy issues

* build: use the correct Toolchain version

* ci: update GitHub Workflows to use valid actions

* ci: add permissions to `clippy_check`

* chore(GH-160): bump dependencies and disable `thread_local_initializer_can_be_made_const` lint

* chore(GH-160): try fixing `thread_local_initializer_can_be_made_const`

* fix(GH-160): `serialized-stdlib` feature

* ci(GH-160): fix `Test Suite`

* fix(GH-160): resolve `insta` deprecation

* ci(GH-160): add formatting check job

* ci(GH-160): reorganize jobs

* style(GH-160): fix formatting

* build(GH-160): fix `#[cfg(never)]`

* build(GH-160): `#[allow(dead_code)]` on `FinishedRanger::end_token`

* build(GH-160): allow more dead code

* test(GH-160): fix `golden.rs`

26 files changed

added.github/workflows/checks.yamldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/checks.yaml
@@ -0,0 +1,25 @@
+name: Checks
+on: [ pull_request ]
+jobs:
+  tests:
+    name: Tests
+    uses: ./.github/workflows/test.yaml
+  lints:
+    name: Lints
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4.1.4
+      - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+      - uses: auguwu/clippy-action@1.3.0
+        with:
+          token: ${{ secrets.GITHUB_TOKEN }}
+    permissions:
+      checks: write
+  formatting:
+    name: Formatting
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4.1.4
+      - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+      - uses: actions-rust-lang/rustfmt@v1.1.0
+
deleted.github/workflows/clippy_check.ymldiffbeforeafterboth
--- a/.github/workflows/clippy_check.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-on: [push, pull_request]
-name: Clippy check
-jobs:
-  clippy_check:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-      - uses: actions-rs/toolchain@v1
-        with:
-            toolchain: nightly-2023-10-28
-            components: clippy
-            override: true
-      - uses: actions-rs/clippy-check@v1
-        with:
-          token: ${{ secrets.GITHUB_TOKEN }}
added.github/workflows/release.yamldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/release.yaml
@@ -0,0 +1,140 @@
+name: Release
+on:
+  push:
+    tags: [ 'v*' ]
+jobs:
+  tests:
+    uses: ./.github/workflows/test.yaml
+
+  cargo-release:
+    if: !endsWith(github.ref, '-test')
+    needs: [ tests ]
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4.1.4
+      - name: Install stable toolchain
+        uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+        with:
+          toolchain: stable
+      - run: cargo install cargo-release
+      - run: cargo login ${{ secrets.CARGO_TOKEN }}
+      - run: cargo release --no-dev-version --skip-push --skip-tag --no-confirm
+
+  github-release:
+    needs: [ tests ]
+    strategy:
+      matrix:
+        target:
+          # Linux build notes:
+          # While musl targets are not as supported as gnu, those are most relevant to users,
+          # which want to download binaries from github, as glibc has compatibility issues
+          # with older distros
+
+          # Tier 1
+          - i686-pc-windows-msvc
+          - x86_64-apple-darwin
+          - x86_64-pc-windows-msvc
+
+          # Tier 2
+          - aarch64-apple-darwin
+          - aarch64-unknown-linux-musl
+          - i686-unknown-linux-musl
+          - x86_64-unknown-linux-musl
+        include:
+          # Linux
+          - target: aarch64-unknown-linux-musl
+            os: ubuntu-latest
+            bin: jrsonnet
+            name: jrsonnet-linux-aarch64
+          - target: i686-unknown-linux-musl
+            os: ubuntu-latest
+            bin: jrsonnet
+            name: jrsonnet-linux-i686
+          - target: x86_64-unknown-linux-musl
+            os: ubuntu-latest
+            bin: jrsonnet
+            name: jrsonnet-linux-amd64
+
+          # Windows
+          - target: i686-pc-windows-msvc
+            os: windows-latest
+            bin: jrsonnet.exe
+            name: jrsonnet-windows-i686.exe
+          - target: x86_64-pc-windows-msvc
+            os: windows-latest
+            bin: jrsonnet.exe
+            name: jrsonnet-windows-amd64.exe
+
+          # Apple
+          - target: aarch64-apple-darwin
+            os: macOS-latest
+            bin: jrsonnet
+            name: jrsonnet-darwin-aarch64
+          - target: x86_64-apple-darwin
+            os: macOS-latest
+            bin: jrsonnet
+            name: jrsonnet-darwin-amd64
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Fetch apt repo updates
+        if: ${{ startsWith(matrix.os, 'ubuntu-') }}
+        run: sudo apt update
+
+      - name: Install stable toolchain
+        uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+        with:
+          toolchain: stable
+          target: ${{ matrix.target }}
+
+      - uses: actions/checkout@v4.1.4
+
+      - name: Add experimental flags
+        if: ${{ endsWith(github.ref, '-test' )}}
+        run: echo 'EXPERIMENTAL_FLAGS=--features=experimental' >> $GITHUB_ENV
+
+      - name: Linux x86 cross compiler
+        if: ${{ startsWith(matrix.target, 'i686-unknown-linux-') }}
+        run: sudo apt install gcc-multilib
+
+      - name: ARM cross compiler
+        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
+        uses: actions-rs/cargo@v1
+        with:
+          command: install
+          args: cross
+
+      - name: ARM gcc
+        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
+        run: sudo apt install gcc-aarch64-linux-gnu
+
+      - name: Musl gcc
+        if: ${{ endsWith(matrix.target, '-musl') }}
+        run: sudo apt install musl musl-tools
+
+      - name: Run cross build
+        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
+        shell: bash
+        run: cross build --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}
+
+      - name: Run build
+        if: ${{ !startsWith(matrix.target, 'aarch64-unknown-linux-') }}
+        run: cargo build --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}
+
+      - name: Package
+        shell: bash
+        run: |
+          cd target/${{ matrix.target }}/release
+
+          cp ${{ matrix.bin }} ../../../${{ matrix.name }}
+          cd -
+
+      - name: Generate SHA-256
+        run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256
+
+      - name: Publish
+        uses: softprops/action-gh-release@v2.0.4
+        with:
+          draft: true
+          files: "jrsonnet*"
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deleted.github/workflows/release.ymldiffbeforeafterboth
--- a/.github/workflows/release.yml
+++ /dev/null
@@ -1,172 +0,0 @@
-name: CI
-on: [push]
-jobs:
-  test:
-    name: Test Suite
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout sources
-        uses: actions/checkout@v2
-      - name: Install stable toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          override: true
-      - name: Run tests
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
-          args: --all
-
-  cargo-release:
-    if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-test')
-    needs: [test]
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout sources
-        uses: actions/checkout@v2
-      - name: Install stable toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          override: true
-      - name: Install cargo release command
-        uses: actions-rs/cargo@v1
-        with:
-          command: install
-          args: cargo-release
-      - name: Run cargo login
-        uses: actions-rs/cargo@v1
-        with:
-          command: login
-          args: ${{ secrets.CARGO_TOKEN }}
-      - name: Publish crates
-        uses: actions-rs/cargo@v1
-        with:
-          command: release
-          args: --no-dev-version --skip-push --skip-tag --no-confirm
-
-  github-release:
-    if: startsWith(github.ref, 'refs/tags/')
-    needs: [test]
-    strategy:
-      matrix:
-        target:
-          # Linux build notes:
-          # While musl targets are not as supported as gnu, those are most relevant to users,
-          # which want to download binaries from github, as glibc has compatibility issues
-          # with older distros
-
-          # Tier 1
-          - i686-pc-windows-msvc
-          - x86_64-apple-darwin
-          - x86_64-pc-windows-msvc
-
-          # Tier 2
-          - aarch64-apple-darwin
-          - aarch64-unknown-linux-musl
-          - i686-unknown-linux-musl
-          - x86_64-unknown-linux-musl
-        include:
-          # Linux
-          - target: aarch64-unknown-linux-musl
-            os: ubuntu-latest
-            bin: jrsonnet
-            name: jrsonnet-linux-aarch64
-          - target: i686-unknown-linux-musl
-            os: ubuntu-latest
-            bin: jrsonnet
-            name: jrsonnet-linux-i686
-          - target: x86_64-unknown-linux-musl
-            os: ubuntu-latest
-            bin: jrsonnet
-            name: jrsonnet-linux-amd64
-
-          # Windows
-          - target: i686-pc-windows-msvc
-            os: windows-latest
-            bin: jrsonnet.exe
-            name: jrsonnet-windows-i686.exe
-          - target: x86_64-pc-windows-msvc
-            os: windows-latest
-            bin: jrsonnet.exe
-            name: jrsonnet-windows-amd64.exe
-
-          # Apple
-          - target: aarch64-apple-darwin
-            os: macOS-latest
-            bin: jrsonnet
-            name: jrsonnet-darwin-aarch64
-          - target: x86_64-apple-darwin
-            os: macOS-latest
-            bin: jrsonnet
-            name: jrsonnet-darwin-amd64
-    runs-on: ${{ matrix.os }}
-    steps:
-      - name: Fetch apt repo updates
-        if: ${{ startsWith(matrix.os, 'ubuntu-') }}
-        run: sudo apt update
-
-      - name: Install stable toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          override: true
-          target: ${{ matrix.target }}
-
-      - name: Checkout
-        uses: actions/checkout@v2
-
-      - name: Add experimental flags
-        if: ${{ endsWith(github.ref, '-test' )}}
-        run: echo 'EXPERIMENTAL_FLAGS=--features=experimental' >> $GITHUB_ENV
-
-      - name: Linux x86 cross compiler
-        if: ${{ startsWith(matrix.target, 'i686-unknown-linux-') }}
-        run: sudo apt install gcc-multilib
-
-      - name: ARM cross compiler
-        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
-        uses: actions-rs/cargo@v1
-        with:
-          command: install
-          args: cross
-
-      - name: ARM gcc
-        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
-        run: sudo apt install gcc-aarch64-linux-gnu
-
-      - name: Musl gcc
-        if: ${{ endsWith(matrix.target, '-musl') }}
-        run: sudo apt install musl musl-tools
-
-      - name: Run cross build
-        if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
-        shell: bash
-        run: cross build --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}
-
-      - name: Run build
-        if: ${{ !startsWith(matrix.target, 'aarch64-unknown-linux-') }}
-        uses: actions-rs/cargo@v1
-        with:
-          command: build
-          args: --bin=jrsonnet --release --target ${{ matrix.target }} ${{ env.EXPERIMENTAL_FLAGS }}
-
-      - name: Package
-        shell: bash
-        run: |
-          cd target/${{ matrix.target }}/release
-
-          cp ${{ matrix.bin }} ../../../${{ matrix.name }}
-          cd -
-
-      - name: Generate SHA-256
-        run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256
-
-      - name: Publish
-        uses: softprops/action-gh-release@v1
-        with:
-          draft: true
-          files: "jrsonnet*"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
added.github/workflows/test.yamldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,21 @@
+name: Test
+on: [ workflow_call ]
+jobs:
+  test:
+    name: Test
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4.1.4
+      - uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+      - run: cargo test --all
+  test-stable:
+    name: Test on stable
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4.1.4
+      - name: Install the latest stable toolchain
+        uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
+        with:
+          toolchain: stable
+      - run: cargo test --all
+
modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@
 
 [[package]]
 name = "ahash"
-version = "0.8.9"
+version = "0.8.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f"
+checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
 dependencies = [
  "cfg-if",
  "once_cell",
@@ -16,24 +16,24 @@
 
 [[package]]
 name = "aho-corasick"
-version = "1.1.2"
+version = "1.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
+checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
 dependencies = [
  "memchr",
 ]
 
 [[package]]
 name = "allocator-api2"
-version = "0.2.16"
+version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
+checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
 
 [[package]]
 name = "annotate-snippets"
-version = "0.10.1"
+version = "0.10.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a433302f833baa830c0092100c481c7ea768c5981a3c36f549517a502f246dd"
+checksum = "6d9b665789884a7e8fb06c84b295e923b03ca51edbb7d08f91a6a50322ecbfe6"
 dependencies = [
  "anstyle",
  "unicode-width",
@@ -41,47 +41,48 @@
 
 [[package]]
 name = "anstream"
-version = "0.6.12"
+version = "0.6.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540"
+checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b"
 dependencies = [
  "anstyle",
  "anstyle-parse",
  "anstyle-query",
  "anstyle-wincon",
  "colorchoice",
+ "is_terminal_polyfill",
  "utf8parse",
 ]
 
 [[package]]
 name = "anstyle"
-version = "1.0.6"
+version = "1.0.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
+checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
 
 [[package]]
 name = "anstyle-parse"
-version = "0.2.3"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
+checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4"
 dependencies = [
  "utf8parse",
 ]
 
 [[package]]
 name = "anstyle-query"
-version = "1.0.2"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
+checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5"
 dependencies = [
  "windows-sys",
 ]
 
 [[package]]
 name = "anstyle-wincon"
-version = "3.0.2"
+version = "3.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
+checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19"
 dependencies = [
  "anstyle",
  "windows-sys",
@@ -89,15 +90,15 @@
 
 [[package]]
 name = "anyhow"
-version = "1.0.80"
+version = "1.0.83"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"
+checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3"
 
 [[package]]
 name = "autocfg"
-version = "1.1.0"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
 
 [[package]]
 name = "base64"
@@ -122,15 +123,9 @@
 
 [[package]]
 name = "bitflags"
-version = "1.3.2"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
 
 [[package]]
 name = "block-buffer"
@@ -143,18 +138,15 @@
 
 [[package]]
 name = "bumpalo"
-version = "3.15.1"
+version = "3.16.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c764d619ca78fccbf3069b37bd7af92577f044bb15236036662d79b6559f25b7"
+checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
 
 [[package]]
 name = "cc"
-version = "1.0.83"
+version = "1.0.97"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
-dependencies = [
- "libc",
-]
+checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4"
 
 [[package]]
 name = "cfg-if"
@@ -164,9 +156,9 @@
 
 [[package]]
 name = "clap"
-version = "4.5.1"
+version = "4.5.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da"
+checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
 dependencies = [
  "clap_builder",
  "clap_derive",
@@ -174,9 +166,9 @@
 
 [[package]]
 name = "clap_builder"
-version = "4.5.1"
+version = "4.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb"
+checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
 dependencies = [
  "anstream",
  "anstyle",
@@ -186,23 +178,23 @@
 
 [[package]]
 name = "clap_complete"
-version = "4.5.1"
+version = "4.5.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c"
+checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e"
 dependencies = [
  "clap",
 ]
 
 [[package]]
 name = "clap_derive"
-version = "4.5.0"
+version = "4.5.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47"
+checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
 dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
 
 [[package]]
@@ -213,9 +205,9 @@
 
 [[package]]
 name = "colorchoice"
-version = "1.0.0"
+version = "1.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
+checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422"
 
 [[package]]
 name = "console"
@@ -283,7 +275,7 @@
 dependencies = [
  "anyhow",
  "bumpalo",
- "indexmap 2.2.3",
+ "indexmap 2.2.6",
  "rustc-hash",
  "serde",
  "unicode-width",
@@ -297,9 +289,9 @@
 
 [[package]]
 name = "either"
-version = "1.10.0"
+version = "1.11.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
+checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
 
 [[package]]
 name = "encode_unicode"
@@ -315,9 +307,9 @@
 
 [[package]]
 name = "errno"
-version = "0.3.8"
+version = "0.3.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
 dependencies = [
  "libc",
  "windows-sys",
@@ -325,9 +317,9 @@
 
 [[package]]
 name = "fastrand"
-version = "2.0.1"
+version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
 
 [[package]]
 name = "fnv"
@@ -347,9 +339,9 @@
 
 [[package]]
 name = "getrandom"
-version = "0.2.12"
+version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
+checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
 dependencies = [
  "cfg-if",
  "libc",
@@ -364,9 +356,9 @@
 
 [[package]]
 name = "hashbrown"
-version = "0.14.3"
+version = "0.14.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
+checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
 dependencies = [
  "ahash",
  "allocator-api2",
@@ -374,9 +366,9 @@
 
 [[package]]
 name = "heck"
-version = "0.4.1"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
+checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
 
 [[package]]
 name = "hi-doc"
@@ -403,35 +395,40 @@
 
 [[package]]
 name = "indexmap"
-version = "2.2.3"
+version = "2.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177"
+checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
 dependencies = [
  "equivalent",
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
  "serde",
 ]
 
 [[package]]
 name = "indoc"
-version = "2.0.4"
+version = "2.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
+checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
 
 [[package]]
 name = "insta"
-version = "1.35.1"
+version = "1.38.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c985c1bef99cf13c58fade470483d81a2bfe846ebde60ed28cc2dddec2df9e2"
+checksum = "3eab73f58e59ca6526037208f0e98851159ec1633cf17b6cd2e1f2c3fd5d53cc"
 dependencies = [
  "console",
  "lazy_static",
  "linked-hash-map",
  "similar",
- "yaml-rust",
 ]
 
 [[package]]
+name = "is_terminal_polyfill"
+version = "1.70.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800"
+
+[[package]]
 name = "itertools"
 version = "0.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -442,9 +439,9 @@
 
 [[package]]
 name = "itoa"
-version = "1.0.10"
+version = "1.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
+checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
 
 [[package]]
 name = "jrsonnet"
@@ -482,7 +479,7 @@
  "anyhow",
  "bincode",
  "derivative",
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
  "hi-doc",
  "jrsonnet-gcmodule",
  "jrsonnet-interner",
@@ -537,7 +534,7 @@
 name = "jrsonnet-interner"
 version = "0.5.0-pre96"
 dependencies = [
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
  "jrsonnet-gcmodule",
  "rustc-hash",
  "serde",
@@ -550,7 +547,7 @@
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
 
 [[package]]
@@ -627,9 +624,9 @@
 
 [[package]]
 name = "libc"
-version = "0.2.153"
+version = "0.2.154"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
+checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346"
 
 [[package]]
 name = "libjsonnet"
@@ -655,9 +652,9 @@
 
 [[package]]
 name = "lock_api"
-version = "0.4.11"
+version = "0.4.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
 dependencies = [
  "autocfg",
  "scopeguard",
@@ -684,7 +681,7 @@
  "proc-macro2",
  "quote",
  "regex-syntax",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
 
 [[package]]
@@ -698,11 +695,11 @@
 
 [[package]]
 name = "lru"
-version = "0.12.2"
+version = "0.12.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22"
+checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
 dependencies = [
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
 ]
 
 [[package]]
@@ -713,15 +710,15 @@
 
 [[package]]
 name = "memchr"
-version = "2.7.1"
+version = "2.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d"
 
 [[package]]
 name = "memoffset"
-version = "0.9.0"
+version = "0.9.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
 dependencies = [
  "autocfg",
 ]
@@ -747,11 +744,10 @@
 
 [[package]]
 name = "num-bigint"
-version = "0.4.4"
+version = "0.4.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
+checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7"
 dependencies = [
- "autocfg",
  "num-integer",
  "num-traits",
  "serde",
@@ -768,9 +764,9 @@
 
 [[package]]
 name = "num-traits"
-version = "0.2.18"
+version = "0.2.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a"
+checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
 dependencies = [
  "autocfg",
 ]
@@ -783,9 +779,9 @@
 
 [[package]]
 name = "parking_lot"
-version = "0.12.1"
+version = "0.12.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb"
 dependencies = [
  "lock_api",
  "parking_lot_core",
@@ -793,15 +789,15 @@
 
 [[package]]
 name = "parking_lot_core"
-version = "0.9.9"
+version = "0.9.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
 dependencies = [
  "cfg-if",
  "libc",
  "redox_syscall",
  "smallvec",
- "windows-targets 0.48.5",
+ "windows-targets",
 ]
 
 [[package]]
@@ -812,9 +808,9 @@
 
 [[package]]
 name = "peg"
-version = "0.8.2"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61"
+checksum = "8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5"
 dependencies = [
  "peg-macros",
  "peg-runtime",
@@ -822,9 +818,9 @@
 
 [[package]]
 name = "peg-macros"
-version = "0.8.2"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90"
+checksum = "f241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582"
 dependencies = [
  "peg-runtime",
  "proc-macro2",
@@ -833,9 +829,9 @@
 
 [[package]]
 name = "peg-runtime"
-version = "0.8.2"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922"
+checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a"
 
 [[package]]
 name = "ppv-lite86"
@@ -845,18 +841,18 @@
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.78"
+version = "1.0.82"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
+checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b"
 dependencies = [
  "unicode-ident",
 ]
 
 [[package]]
 name = "quote"
-version = "1.0.35"
+version = "1.0.36"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
 dependencies = [
  "proc-macro2",
 ]
@@ -911,18 +907,18 @@
 
 [[package]]
 name = "redox_syscall"
-version = "0.4.1"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e"
 dependencies = [
- "bitflags 1.3.2",
+ "bitflags",
 ]
 
 [[package]]
 name = "regex"
-version = "1.10.3"
+version = "1.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
+checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -932,9 +928,9 @@
 
 [[package]]
 name = "regex-automata"
-version = "0.4.5"
+version = "0.4.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"
+checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -943,9 +939,9 @@
 
 [[package]]
 name = "regex-syntax"
-version = "0.8.2"
+version = "0.8.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
+checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
 
 [[package]]
 name = "rowan"
@@ -954,7 +950,7 @@
 checksum = "32a58fa8a7ccff2aec4f39cc45bf5f985cec7125ab271cf681c279fd00192b49"
 dependencies = [
  "countme",
- "hashbrown 0.14.3",
+ "hashbrown 0.14.5",
  "memoffset",
  "rustc-hash",
  "text-size",
@@ -968,11 +964,11 @@
 
 [[package]]
 name = "rustix"
-version = "0.38.31"
+version = "0.38.34"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
+checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
 dependencies = [
- "bitflags 2.4.2",
+ "bitflags",
  "errno",
  "libc",
  "linux-raw-sys",
@@ -981,9 +977,9 @@
 
 [[package]]
 name = "ryu"
-version = "1.0.17"
+version = "1.0.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
+checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
 
 [[package]]
 name = "scopeguard"
@@ -993,29 +989,29 @@
 
 [[package]]
 name = "serde"
-version = "1.0.197"
+version = "1.0.201"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
+checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.197"
+version = "1.0.201"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
+checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
 
 [[package]]
 name = "serde_json"
-version = "1.0.114"
+version = "1.0.117"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0"
+checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
 dependencies = [
  "itoa",
  "ryu",
@@ -1068,9 +1064,9 @@
 
 [[package]]
 name = "similar"
-version = "2.4.0"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21"
+checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640"
 
 [[package]]
 name = "smallvec"
@@ -1086,9 +1082,9 @@
 
 [[package]]
 name = "strsim"
-version = "0.11.0"
+version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01"
+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
 
 [[package]]
 name = "structdump"
@@ -1125,9 +1121,9 @@
 
 [[package]]
 name = "syn"
-version = "2.0.50"
+version = "2.0.61"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb"
+checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -1136,9 +1132,9 @@
 
 [[package]]
 name = "tempfile"
-version = "3.10.0"
+version = "3.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67"
+checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
 dependencies = [
  "cfg-if",
  "fastrand",
@@ -1164,22 +1160,22 @@
 
 [[package]]
 name = "thiserror"
-version = "1.0.57"
+version = "1.0.60"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
+checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.57"
+version = "1.0.60"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
+checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
 
 [[package]]
@@ -1202,9 +1198,9 @@
 
 [[package]]
 name = "unicode-width"
-version = "0.1.11"
+version = "0.1.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
+checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6"
 
 [[package]]
 name = "utf8parse"
@@ -1230,144 +1226,94 @@
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
 dependencies = [
- "windows-targets 0.52.0",
+ "windows-targets",
 ]
 
 [[package]]
 name = "windows-targets"
-version = "0.48.5"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
 dependencies = [
- "windows_aarch64_gnullvm 0.48.5",
- "windows_aarch64_msvc 0.48.5",
- "windows_i686_gnu 0.48.5",
- "windows_i686_msvc 0.48.5",
- "windows_x86_64_gnu 0.48.5",
- "windows_x86_64_gnullvm 0.48.5",
- "windows_x86_64_msvc 0.48.5",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
-dependencies = [
- "windows_aarch64_gnullvm 0.52.0",
- "windows_aarch64_msvc 0.52.0",
- "windows_i686_gnu 0.52.0",
- "windows_i686_msvc 0.52.0",
- "windows_x86_64_gnu 0.52.0",
- "windows_x86_64_gnullvm 0.52.0",
- "windows_x86_64_msvc 0.52.0",
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
 ]
 
 [[package]]
 name = "windows_aarch64_gnullvm"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.5"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
 
 [[package]]
 name = "windows_aarch64_msvc"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.5"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
 
 [[package]]
 name = "windows_i686_gnu"
-version = "0.52.0"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
+checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
 
 [[package]]
-name = "windows_i686_msvc"
-version = "0.48.5"
+name = "windows_i686_gnullvm"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
 
 [[package]]
 name = "windows_i686_msvc"
-version = "0.52.0"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
 
 [[package]]
 name = "windows_x86_64_gnu"
-version = "0.52.0"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
+checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
 
 [[package]]
 name = "windows_x86_64_gnullvm"
-version = "0.48.5"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
 
 [[package]]
 name = "windows_x86_64_msvc"
-version = "0.52.0"
+version = "0.52.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
+checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
 
 [[package]]
 name = "xshell"
-version = "0.2.5"
+version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce2107fe03e558353b4c71ad7626d58ed82efaf56c54134228608893c77023ad"
+checksum = "6db0ab86eae739efd1b054a8d3d16041914030ac4e01cd1dca0cf252fd8b6437"
 dependencies = [
  "xshell-macros",
 ]
 
 [[package]]
 name = "xshell-macros"
-version = "0.2.5"
+version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e2c411759b501fb9501aac2b1b2d287a6e93e5bdcf13c25306b23e1b716dd0e"
+checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852"
 
 [[package]]
 name = "xtask"
 version = "0.1.0"
 dependencies = [
  "anyhow",
- "indexmap 2.2.3",
+ "indexmap 2.2.6",
  "itertools",
  "proc-macro2",
  "quote",
@@ -1386,20 +1332,20 @@
 
 [[package]]
 name = "zerocopy"
-version = "0.7.32"
+version = "0.7.34"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
+checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
 dependencies = [
  "zerocopy-derive",
 ]
 
 [[package]]
 name = "zerocopy-derive"
-version = "0.7.32"
+version = "0.7.34"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
+checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn 2.0.50",
+ "syn 2.0.61",
 ]
modifiedcmds/jrsonnet-fmt/src/tests.rsdiffbeforeafterboth
--- a/cmds/jrsonnet-fmt/src/tests.rs
+++ b/cmds/jrsonnet-fmt/src/tests.rs
@@ -23,7 +23,7 @@
 
 #[test]
 fn complex_comments_snapshot() {
-	insta::assert_display_snapshot!(reformat(indoc!(
+	insta::assert_snapshot!(reformat(indoc!(
 		"{
 		  comments: {
 			_: '',
modifiedcrates/jrsonnet-cli/src/tla.rsdiffbeforeafterboth
--- a/crates/jrsonnet-cli/src/tla.rs
+++ b/crates/jrsonnet-cli/src/tla.rs
@@ -14,7 +14,7 @@
 pub struct TlaOpts {
 	/// Add top level string argument.
 	/// Top level arguments will be passed to function before manifestification stage.
-	/// This is preferred to ExtVars method.
+	/// This is preferred to [`ExtVars`] method.
 	/// If [=data] is not set then it will be read from `name` env variable.
 	#[clap(long, short = 'A', name = "name[=tla data]", number_of_values = 1)]
 	tla_str: Vec<ExtStr>,
modifiedcrates/jrsonnet-evaluator/src/arr/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/mod.rs
+++ b/crates/jrsonnet-evaluator/src/arr/mod.rs
@@ -7,8 +7,7 @@
 use crate::{function::FuncVal, gc::TraceBox, tb, Context, Result, Thunk, Val};
 
 mod spec;
-pub use spec::ArrayLike;
-pub(crate) use spec::*;
+pub use spec::{ArrayLike, *};
 
 /// Represents a Jsonnet array value.
 #[derive(Debug, Clone, Trace)]
modifiedcrates/jrsonnet-evaluator/src/function/arglike.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/arglike.rs
+++ b/crates/jrsonnet-evaluator/src/function/arglike.rs
@@ -76,13 +76,6 @@
 	}
 }
 
-mod sealed {
-	/// Implemented for `ArgsLike`, where only unnamed arguments present
-	pub trait Unnamed {}
-	/// Implemented for `ArgsLike`, where only named arguments present
-	pub trait Named {}
-}
-
 pub trait ArgsLike {
 	fn unnamed_len(&self) -> usize;
 	fn unnamed_iter(
@@ -182,7 +175,6 @@
 	}
 }
 
-impl<V: ArgLike, S> sealed::Named for HashMap<IStr, V, S> {}
 impl<V: ArgLike, S> ArgsLike for HashMap<IStr, V, S> {
 	fn unnamed_len(&self) -> usize {
 		0
@@ -247,7 +239,6 @@
 
 macro_rules! impl_args_like {
 	($count:expr; $($gen:ident)*) => {
-		impl<$($gen: ArgLike,)*> sealed::Unnamed for ($($gen,)*) {}
 		impl<$($gen: ArgLike,)*> ArgsLike for ($($gen,)*) {
 			fn unnamed_len(&self) -> usize {
 				$count
@@ -279,7 +270,6 @@
 		}
 		impl<$($gen: ArgLike,)*> OptionalContext for ($($gen,)*) where $($gen: OptionalContext),* {}
 
-		impl<$($gen: ArgLike,)*> sealed::Named for ($((IStr, $gen),)*) {}
 		impl<$($gen: ArgLike,)*> ArgsLike for ($((IStr, $gen),)*) {
 			fn unnamed_len(&self) -> usize {
 				0
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/integrations/serde.rs
+++ b/crates/jrsonnet-evaluator/src/integrations/serde.rs
@@ -346,9 +346,9 @@
 	type Ok = Val;
 	type Error = JrError;
 
-	fn serialize_key<T: ?Sized>(&mut self, key: &T) -> Result<()>
+	fn serialize_key<T>(&mut self, key: &T) -> Result<()>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		let key = key.serialize(IntoValSerializer)?;
 		let key = key.to_string()?;
@@ -356,9 +356,9 @@
 		Ok(())
 	}
 
-	fn serialize_value<T: ?Sized>(&mut self, value: &T) -> Result<()>
+	fn serialize_value<T>(&mut self, value: &T) -> Result<()>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		let key = self.key.take().expect("no serialize_key called");
 		let value = value.serialize(IntoValSerializer)?;
@@ -367,10 +367,10 @@
 	}
 
 	// TODO: serialize_key/serialize_value
-	fn serialize_entry<K: ?Sized, V: ?Sized>(&mut self, key: &K, value: &V) -> Result<()>
+	fn serialize_entry<K, V>(&mut self, key: &K, value: &V) -> Result<()>
 	where
-		K: Serialize,
-		V: Serialize,
+		K: ?Sized + Serialize,
+		V: ?Sized + Serialize,
 	{
 		let key = key.serialize(IntoValSerializer)?;
 		let key = key.to_string()?;
@@ -394,9 +394,9 @@
 	type Ok = Val;
 	type Error = JrError;
 
-	fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<()>
+	fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<()>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		SerializeMap::serialize_entry(self, key, value)?;
 		Ok(())
@@ -411,9 +411,9 @@
 
 	type Error = JrError;
 
-	fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<()>
+	fn serialize_field<T>(&mut self, key: &'static str, value: &T) -> Result<()>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		SerializeMap::serialize_entry(self, key, value)?;
 		Ok(())
@@ -504,9 +504,9 @@
 		Ok(Val::Null)
 	}
 
-	fn serialize_some<T: ?Sized>(self, value: &T) -> Result<Val>
+	fn serialize_some<T>(self, value: &T) -> Result<Val>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		value.serialize(self)
 	}
@@ -528,14 +528,14 @@
 		Ok(Val::Str(variant.into()))
 	}
 
-	fn serialize_newtype_struct<T: ?Sized>(self, _name: &'static str, value: &T) -> Result<Val>
+	fn serialize_newtype_struct<T>(self, _name: &'static str, value: &T) -> Result<Val>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		value.serialize(self)
 	}
 
-	fn serialize_newtype_variant<T: ?Sized>(
+	fn serialize_newtype_variant<T>(
 		self,
 		_name: &'static str,
 		_variant_index: u32,
@@ -543,7 +543,7 @@
 		value: &T,
 	) -> Result<Val>
 	where
-		T: Serialize,
+		T: ?Sized + Serialize,
 	{
 		let mut out = ObjValue::builder_with_capacity(1);
 		let value = value.serialize(self)?;
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -1,4 +1,4 @@
-use std::{borrow::Cow, fmt::Write};
+use std::{borrow::Cow, fmt::Write, ptr};
 
 use crate::{bail, Result, ResultExt, State, Val};
 
@@ -404,7 +404,7 @@
 
 pub fn escape_string_json_buf(value: &str, buf: &mut String) {
 	// Safety: we only write correct utf-8 in this function
-	let buf: &mut Vec<u8> = unsafe { &mut *(buf as *mut String).cast::<Vec<u8>>() };
+	let buf: &mut Vec<u8> = unsafe { &mut *ptr::from_mut(buf).cast::<Vec<u8>>() };
 	let bytes = value.as_bytes();
 
 	// Perfect for ascii strings, removes any reallocations
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -88,7 +88,7 @@
 	}
 }
 
-use ordering::*;
+use ordering::{FieldIndex, FieldSortKey, SuperDepth};
 
 // 0 - add
 //  12 - visibility
modifiedcrates/jrsonnet-evaluator/src/stack.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/stack.rs
+++ b/crates/jrsonnet-evaluator/src/stack.rs
@@ -8,6 +8,7 @@
 }
 
 #[cfg(feature = "nightly")]
+#[allow(clippy::thread_local_initializer_can_be_made_const)]
 #[thread_local]
 static STACK_LIMIT: StackLimit = StackLimit {
 	max_stack_size: Cell::new(200),
@@ -15,9 +16,11 @@
 };
 #[cfg(not(feature = "nightly"))]
 thread_local! {
-	static STACK_LIMIT: StackLimit = StackLimit {
-		max_stack_size: Cell::new(200),
-		current_depth: Cell::new(0),
+	static STACK_LIMIT: StackLimit = const {
+		StackLimit {
+			max_stack_size: Cell::new(200),
+			current_depth: Cell::new(0),
+		}
 	};
 }
 
@@ -40,7 +43,7 @@
 	fn drop(&mut self) {
 		STACK_LIMIT
 			.current_depth
-			.set(STACK_LIMIT.current_depth.get() - 1)
+			.set(STACK_LIMIT.current_depth.get() - 1);
 	}
 	#[cfg(not(feature = "nightly"))]
 	fn drop(&mut self) {
@@ -75,7 +78,7 @@
 impl Drop for StackDepthLimitOverrideGuard {
 	#[cfg(feature = "nightly")]
 	fn drop(&mut self) {
-		STACK_LIMIT.max_stack_size.set(self.old_limit)
+		STACK_LIMIT.max_stack_size.set(self.old_limit);
 	}
 	#[cfg(not(feature = "nightly"))]
 	fn drop(&mut self) {
modifiedcrates/jrsonnet-evaluator/src/typed/conversions.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed/conversions.rs
+++ b/crates/jrsonnet-evaluator/src/typed/conversions.rs
@@ -143,6 +143,7 @@
 					_ => unreachable!(),
 				}
 			}
+			#[allow(clippy::cast_lossless)]
 			fn into_untyped(value: Self) -> Result<Val> {
 				Ok(Val::Num(value as f64))
 			}
@@ -199,6 +200,7 @@
 				}
 			}
 
+			#[allow(clippy::cast_lossless)]
 			fn into_untyped(value: Self) -> Result<Val> {
 				Ok(Val::Num(value.0 as f64))
 			}
modifiedcrates/jrsonnet-rowan-parser/src/marker.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/marker.rs
+++ b/crates/jrsonnet-rowan-parser/src/marker.rs
@@ -22,6 +22,7 @@
 
 pub struct FinishedRanger {
 	pub start_token: usize,
+	#[allow(dead_code)]
 	pub end_token: usize,
 }
 impl FinishedRanger {
modifiedcrates/jrsonnet-rowan-parser/src/tests.rsdiffbeforeafterboth
--- a/crates/jrsonnet-rowan-parser/src/tests.rs
+++ b/crates/jrsonnet-rowan-parser/src/tests.rs
@@ -1,4 +1,5 @@
-#![cfg(never)]
+// `never`
+#![cfg(any())]
 
 use miette::{
 	Diagnostic, GraphicalReportHandler, GraphicalTheme, LabeledSpan, ThemeCharacters, ThemeStyles,
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -12,19 +12,23 @@
 
 [features]
 default = ["codegenerated-stdlib"]
-# Speed-up initialization by generating code for parsed stdlib, instead
-# of invoking parser for it
+# Speed-up initialization by generating code for parsed stdlib,
+# instead of invoking parser for it.
+# This is mutually exclusive with `serialized-stdlib`.
 codegenerated-stdlib = ["jrsonnet-parser/structdump"]
+# Use the embedded serialized stdlib.
+# This is mutually exclusive with `codegenerated-stdlib`.
+serialized-stdlib = []
 # Enables legacy `std.thisFile` support, at the cost of worse caching
 legacy-this-file = []
 # Add order preservation flag to some functions
 exp-preserve-order = ["jrsonnet-evaluator/exp-preserve-order"]
 # Bigint type
-exp-bigint = ["num-bigint", "jrsonnet-evaluator/exp-bigint"]
+exp-bigint = ["dep:num-bigint", "jrsonnet-evaluator/exp-bigint"]
 
 exp-null-coaelse = ["jrsonnet-parser/exp-null-coaelse", "jrsonnet-evaluator/exp-null-coaelse"]
 # std.regexMatch and other helpers
-exp-regex = ["regex", "lru", "rustc-hash"]
+exp-regex = ["dep:regex", "dep:lru", "dep:rustc-hash"]
 
 [dependencies]
 jrsonnet-evaluator.workspace = true
modifiedcrates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/expr.rs
+++ b/crates/jrsonnet-stdlib/src/expr.rs
@@ -1,7 +1,11 @@
 use jrsonnet_parser::LocExpr;
 
 pub fn stdlib_expr() -> LocExpr {
-	#[cfg(feature = "serialized-stdlib")]
+	#[cfg(all(feature = "serialized-stdlib", feature = "codegenerated-stdlib"))]
+	compile_error!(
+		"features `serialized-stdlib` and `codegenerated-stdlib` are mutually exclusive"
+	);
+	#[cfg(all(feature = "serialized-stdlib", not(feature = "codegenerated-stdlib")))]
 	{
 		use bincode::{BincodeRead, DefaultOptions, Options};
 		use serde::{Deserialize, Deserializer};
@@ -77,7 +81,7 @@
 		LocExpr::deserialize(&mut deserializer).unwrap()
 	}
 
-	#[cfg(feature = "codegenerated-stdlib")]
+	#[cfg(all(feature = "codegenerated-stdlib", not(feature = "serialized-stdlib")))]
 	{
 		mod structdump_import {
 			pub(super) use std::{option::Option, rc::Rc, vec};
@@ -88,7 +92,7 @@
 		include!(concat!(env!("OUT_DIR"), "/stdlib.rs"))
 	}
 
-	#[cfg(not(feature = "codegenerated-stdlib"))]
+	#[cfg(not(any(feature = "serialized-stdlib", feature = "codegenerated-stdlib")))]
 	{
 		use jrsonnet_parser::Source;
 
modifiedcrates/jrsonnet-stdlib/src/lib.rsdiffbeforeafterboth
before · crates/jrsonnet-stdlib/src/lib.rs
1use std::{2	cell::{Ref, RefCell, RefMut},3	collections::HashMap,4	rc::Rc,5};67use jrsonnet_evaluator::{8	error::{ErrorKind::*, Result},9	function::{CallLocation, FuncVal, TlaArg},10	tb,11	trace::PathResolver,12	ContextBuilder, IStr, ObjValue, ObjValueBuilder, State, Thunk, Val,13};14use jrsonnet_gcmodule::Trace;15use jrsonnet_parser::Source;1617mod expr;18mod types;19pub use types::*;20mod arrays;21pub use arrays::*;22mod math;23pub use math::*;24mod operator;25pub use operator::*;26mod sort;27pub use sort::*;28mod hash;29pub use hash::*;30mod encoding;31pub use encoding::*;32mod objects;33pub use objects::*;34mod manifest;35pub use manifest::*;36mod parse;37pub use parse::*;38mod strings;39pub use strings::*;40mod misc;41pub use misc::*;42mod sets;43pub use sets::*;44mod compat;45pub use compat::*;46#[cfg(feature = "exp-regex")]47mod regex;48#[cfg(feature = "exp-regex")]49pub use crate::regex::*;5051#[allow(clippy::too_many_lines)]52pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {53	let mut builder = ObjValueBuilder::new();5455	let expr = expr::stdlib_expr();56	let eval = jrsonnet_evaluator::evaluate(ContextBuilder::dangerous_empty_state().build(), &expr)57		.expect("stdlib.jsonnet should have no errors")58		.as_obj()59		.expect("stdlib.jsonnet should evaluate to object");6061	builder.with_super(eval);6263	// FIXME: Use PHF64	for (name, builtin) in [65		// Types66		("type", builtin_type::INST),67		("isString", builtin_is_string::INST),68		("isNumber", builtin_is_number::INST),69		("isBoolean", builtin_is_boolean::INST),70		("isObject", builtin_is_object::INST),71		("isArray", builtin_is_array::INST),72		("isFunction", builtin_is_function::INST),73		// Arrays74		("makeArray", builtin_make_array::INST),75		("repeat", builtin_repeat::INST),76		("slice", builtin_slice::INST),77		("map", builtin_map::INST),78		("flatMap", builtin_flatmap::INST),79		("filter", builtin_filter::INST),80		("foldl", builtin_foldl::INST),81		("foldr", builtin_foldr::INST),82		("range", builtin_range::INST),83		("join", builtin_join::INST),84		("reverse", builtin_reverse::INST),85		("any", builtin_any::INST),86		("all", builtin_all::INST),87		("member", builtin_member::INST),88		("contains", builtin_contains::INST),89		("count", builtin_count::INST),90		("avg", builtin_avg::INST),91		("removeAt", builtin_remove_at::INST),92		("remove", builtin_remove::INST),93		("flattenArrays", builtin_flatten_arrays::INST),94		("flattenDeepArray", builtin_flatten_deep_array::INST),95		("prune", builtin_prune::INST),96		("filterMap", builtin_filter_map::INST),97		// Math98		("abs", builtin_abs::INST),99		("sign", builtin_sign::INST),100		("max", builtin_max::INST),101		("min", builtin_min::INST),102		("sum", builtin_sum::INST),103		("modulo", builtin_modulo::INST),104		("floor", builtin_floor::INST),105		("ceil", builtin_ceil::INST),106		("log", builtin_log::INST),107		("pow", builtin_pow::INST),108		("sqrt", builtin_sqrt::INST),109		("sin", builtin_sin::INST),110		("cos", builtin_cos::INST),111		("tan", builtin_tan::INST),112		("asin", builtin_asin::INST),113		("acos", builtin_acos::INST),114		("atan", builtin_atan::INST),115		("atan2", builtin_atan2::INST),116		("exp", builtin_exp::INST),117		("mantissa", builtin_mantissa::INST),118		("exponent", builtin_exponent::INST),119		("round", builtin_round::INST),120		("isEven", builtin_is_even::INST),121		("isOdd", builtin_is_odd::INST),122		("isInteger", builtin_is_integer::INST),123		("isDecimal", builtin_is_decimal::INST),124		// Operator125		("mod", builtin_mod::INST),126		("primitiveEquals", builtin_primitive_equals::INST),127		("equals", builtin_equals::INST),128		("xor", builtin_xor::INST),129		("xnor", builtin_xnor::INST),130		("format", builtin_format::INST),131		// Sort132		("sort", builtin_sort::INST),133		("uniq", builtin_uniq::INST),134		("set", builtin_set::INST),135		("minArray", builtin_min_array::INST),136		("maxArray", builtin_max_array::INST),137		// Hash138		("md5", builtin_md5::INST),139		("sha1", builtin_sha1::INST),140		("sha256", builtin_sha256::INST),141		("sha512", builtin_sha512::INST),142		("sha3", builtin_sha3::INST),143		// Encoding144		("encodeUTF8", builtin_encode_utf8::INST),145		("decodeUTF8", builtin_decode_utf8::INST),146		("base64", builtin_base64::INST),147		("base64Decode", builtin_base64_decode::INST),148		("base64DecodeBytes", builtin_base64_decode_bytes::INST),149		// Objects150		("objectFieldsEx", builtin_object_fields_ex::INST),151		("objectFields", builtin_object_fields::INST),152		("objectFieldsAll", builtin_object_fields_all::INST),153		("objectValues", builtin_object_values::INST),154		("objectValuesAll", builtin_object_values_all::INST),155		("objectKeysValues", builtin_object_keys_values::INST),156		("objectKeysValuesAll", builtin_object_keys_values_all::INST),157		("objectHasEx", builtin_object_has_ex::INST),158		("objectHas", builtin_object_has::INST),159		("objectHasAll", builtin_object_has_all::INST),160		("objectRemoveKey", builtin_object_remove_key::INST),161		// Manifest162		("escapeStringJson", builtin_escape_string_json::INST),163		("manifestJsonEx", builtin_manifest_json_ex::INST),164		("manifestYamlDoc", builtin_manifest_yaml_doc::INST),165		("manifestTomlEx", builtin_manifest_toml_ex::INST),166		("toString", builtin_to_string::INST),167		// Parsing168		("parseJson", builtin_parse_json::INST),169		("parseYaml", builtin_parse_yaml::INST),170		// Strings171		("codepoint", builtin_codepoint::INST),172		("substr", builtin_substr::INST),173		("char", builtin_char::INST),174		("strReplace", builtin_str_replace::INST),175		("isEmpty", builtin_is_empty::INST),176		("equalsIgnoreCase", builtin_equals_ignore_case::INST),177		("splitLimit", builtin_splitlimit::INST),178		("asciiUpper", builtin_ascii_upper::INST),179		("asciiLower", builtin_ascii_lower::INST),180		("findSubstr", builtin_find_substr::INST),181		("parseInt", builtin_parse_int::INST),182		#[cfg(feature = "exp-bigint")]183		("bigint", builtin_bigint::INST),184		("parseOctal", builtin_parse_octal::INST),185		("parseHex", builtin_parse_hex::INST),186		("stringChars", builtin_string_chars::INST),187		// Misc188		("length", builtin_length::INST),189		("startsWith", builtin_starts_with::INST),190		("endsWith", builtin_ends_with::INST),191		// Sets192		("setMember", builtin_set_member::INST),193		("setInter", builtin_set_inter::INST),194		("setDiff", builtin_set_diff::INST),195		("setUnion", builtin_set_union::INST),196		// Regex197		#[cfg(feature = "exp-regex")]198		("regexQuoteMeta", builtin_regex_quote_meta::INST),199		// Compat200		("__compare", builtin___compare::INST),201	]202	.iter()203	.copied()204	{205		builder.method(name, builtin);206	}207208	builder.method(209		"extVar",210		builtin_ext_var {211			settings: settings.clone(),212		},213	);214	builder.method(215		"native",216		builtin_native {217			settings: settings.clone(),218		},219	);220	builder.method("trace", builtin_trace { settings });221	builder.method("id", FuncVal::Id);222223	#[cfg(feature = "exp-regex")]224	{225		// Regex226		let regex_cache = RegexCache::default();227		builder.method(228			"regexFullMatch",229			builtin_regex_full_match {230				cache: regex_cache.clone(),231			},232		);233		builder.method(234			"regexPartialMatch",235			builtin_regex_partial_match {236				cache: regex_cache.clone(),237			},238		);239		builder.method(240			"regexReplace",241			builtin_regex_replace {242				cache: regex_cache.clone(),243			},244		);245		builder.method(246			"regexGlobalReplace",247			builtin_regex_global_replace {248				cache: regex_cache.clone(),249			},250		);251	};252253	builder.build()254}255256pub trait TracePrinter {257	fn print_trace(&self, loc: CallLocation, value: IStr);258}259260pub struct StdTracePrinter {261	resolver: PathResolver,262}263impl StdTracePrinter {264	pub fn new(resolver: PathResolver) -> Self {265		Self { resolver }266	}267}268impl TracePrinter for StdTracePrinter {269	fn print_trace(&self, loc: CallLocation, value: IStr) {270		eprint!("TRACE:");271		if let Some(loc) = loc.0 {272			let locs = loc.0.map_source_locations(&[loc.1]);273			eprint!(274				" {}:{}",275				loc.0.source_path().path().map_or_else(276					|| loc.0.source_path().to_string(),277					|p| self.resolver.resolve(p)278				),279				locs[0].line280			);281		}282		eprintln!(" {value}");283	}284}285286pub struct Settings {287	/// Used for `std.extVar`288	pub ext_vars: HashMap<IStr, TlaArg>,289	/// Used for `std.native`290	pub ext_natives: HashMap<IStr, FuncVal>,291	/// Used for `std.trace`292	pub trace_printer: Box<dyn TracePrinter>,293	/// Used for `std.thisFile`294	pub path_resolver: PathResolver,295}296297fn extvar_source(name: &str, code: impl Into<IStr>) -> Source {298	let source_name = format!("<extvar:{name}>");299	Source::new_virtual(source_name.into(), code.into())300}301302#[derive(Trace, Clone)]303pub struct ContextInitializer {304	/// When we don't need to support legacy-this-file, we can reuse same context for all files305	#[cfg(not(feature = "legacy-this-file"))]306	context: jrsonnet_evaluator::Context,307	/// For `populate`308	#[cfg(not(feature = "legacy-this-file"))]309	stdlib_thunk: Thunk<Val>,310	/// Otherwise, we can only keep first stdlib layer, and then stack thisFile on top of it311	#[cfg(feature = "legacy-this-file")]312	stdlib_obj: ObjValue,313	settings: Rc<RefCell<Settings>>,314}315impl ContextInitializer {316	pub fn new(s: State, resolver: PathResolver) -> Self {317		let settings = Settings {318			ext_vars: HashMap::new(),319			ext_natives: HashMap::new(),320			trace_printer: Box::new(StdTracePrinter::new(resolver.clone())),321			path_resolver: resolver,322		};323		let settings = Rc::new(RefCell::new(settings));324		let stdlib_obj = stdlib_uncached(settings.clone());325		#[cfg(not(feature = "legacy-this-file"))]326		let stdlib_thunk = Thunk::evaluated(Val::Obj(stdlib_obj));327		#[cfg(feature = "legacy-this-file")]328		let _ = s;329		Self {330			#[cfg(not(feature = "legacy-this-file"))]331			context: {332				let mut context = ContextBuilder::with_capacity(s, 1);333				context.bind("std", stdlib_thunk.clone());334				context.build()335			},336			#[cfg(not(feature = "legacy-this-file"))]337			stdlib_thunk,338			#[cfg(feature = "legacy-this-file")]339			stdlib_obj,340			settings,341		}342	}343	pub fn settings(&self) -> Ref<Settings> {344		self.settings.borrow()345	}346	pub fn settings_mut(&self) -> RefMut<Settings> {347		self.settings.borrow_mut()348	}349	pub fn add_ext_var(&self, name: IStr, value: Val) {350		self.settings_mut()351			.ext_vars352			.insert(name, TlaArg::Val(value));353	}354	pub fn add_ext_str(&self, name: IStr, value: IStr) {355		self.settings_mut()356			.ext_vars357			.insert(name, TlaArg::String(value));358	}359	pub fn add_ext_code(&self, name: &str, code: impl Into<IStr>) -> Result<()> {360		let code = code.into();361		let source = extvar_source(name, code.clone());362		let parsed = jrsonnet_parser::parse(363			&code,364			&jrsonnet_parser::ParserSettings {365				source: source.clone(),366			},367		)368		.map_err(|e| ImportSyntaxError {369			path: source,370			error: Box::new(e),371		})?;372		// self.data_mut().volatile_files.insert(source_name, code);373		self.settings_mut()374			.ext_vars375			.insert(name.into(), TlaArg::Code(parsed));376		Ok(())377	}378	pub fn add_native(&self, name: impl Into<IStr>, cb: impl Into<FuncVal>) {379		self.settings_mut()380			.ext_natives381			.insert(name.into(), cb.into());382	}383}384impl jrsonnet_evaluator::ContextInitializer for ContextInitializer {385	fn reserve_vars(&self) -> usize {386		1387	}388	#[cfg(not(feature = "legacy-this-file"))]389	fn initialize(&self, _s: State, _source: Source) -> jrsonnet_evaluator::Context {390		self.context.clone()391	}392	#[cfg(not(feature = "legacy-this-file"))]393	fn populate(&self, _for_file: Source, builder: &mut ContextBuilder) {394		builder.bind("std", self.stdlib_thunk.clone());395	}396	#[cfg(feature = "legacy-this-file")]397	fn populate(&self, source: Source, builder: &mut ContextBuilder) {398		use jrsonnet_evaluator::val::StrValue;399400		let mut std = ObjValueBuilder::new();401		std.with_super(self.stdlib_obj.clone());402		std.field("thisFile")403			.hide()404			.value(match source.source_path().path() {405				Some(p) => self.settings().path_resolver.resolve(p),406				None => source.source_path().to_string(),407			});408		let stdlib_with_this_file = std.build();409410		builder.bind("std", Thunk::evaluated(Val::Obj(stdlib_with_this_file)));411	}412	fn as_any(&self) -> &dyn std::any::Any {413		self414	}415}416417pub trait StateExt {418	/// This method was previously implemented in jrsonnet-evaluator itself419	fn with_stdlib(&self);420}421422impl StateExt for State {423	fn with_stdlib(&self) {424		let initializer = ContextInitializer::new(self.clone(), PathResolver::new_cwd_fallback());425		self.settings_mut().context_initializer = tb!(initializer);426	}427}
after · crates/jrsonnet-stdlib/src/lib.rs
1#![allow(clippy::similar_names)]23use std::{4	cell::{Ref, RefCell, RefMut},5	collections::HashMap,6	rc::Rc,7};89pub use arrays::*;10pub use compat::*;11pub use encoding::*;12pub use hash::*;13use jrsonnet_evaluator::{14	error::{ErrorKind::*, Result},15	function::{CallLocation, FuncVal, TlaArg},16	tb,17	trace::PathResolver,18	ContextBuilder, IStr, ObjValue, ObjValueBuilder, State, Thunk, Val,19};20use jrsonnet_gcmodule::Trace;21use jrsonnet_parser::Source;22pub use manifest::*;23pub use math::*;24pub use misc::*;25pub use objects::*;26pub use operator::*;27pub use parse::*;28pub use sets::*;29pub use sort::*;30pub use strings::*;31pub use types::*;3233#[cfg(feature = "exp-regex")]34pub use crate::regex::*;3536mod arrays;37mod compat;38mod encoding;39mod expr;40mod hash;41mod manifest;42mod math;43mod misc;44mod objects;45mod operator;46mod parse;47#[cfg(feature = "exp-regex")]48mod regex;49mod sets;50mod sort;51mod strings;52mod types;5354#[allow(clippy::too_many_lines)]55pub fn stdlib_uncached(settings: Rc<RefCell<Settings>>) -> ObjValue {56	let mut builder = ObjValueBuilder::new();5758	let expr = expr::stdlib_expr();59	let eval = jrsonnet_evaluator::evaluate(ContextBuilder::dangerous_empty_state().build(), &expr)60		.expect("stdlib.jsonnet should have no errors")61		.as_obj()62		.expect("stdlib.jsonnet should evaluate to object");6364	builder.with_super(eval);6566	// FIXME: Use PHF67	for (name, builtin) in [68		// Types69		("type", builtin_type::INST),70		("isString", builtin_is_string::INST),71		("isNumber", builtin_is_number::INST),72		("isBoolean", builtin_is_boolean::INST),73		("isObject", builtin_is_object::INST),74		("isArray", builtin_is_array::INST),75		("isFunction", builtin_is_function::INST),76		// Arrays77		("makeArray", builtin_make_array::INST),78		("repeat", builtin_repeat::INST),79		("slice", builtin_slice::INST),80		("map", builtin_map::INST),81		("flatMap", builtin_flatmap::INST),82		("filter", builtin_filter::INST),83		("foldl", builtin_foldl::INST),84		("foldr", builtin_foldr::INST),85		("range", builtin_range::INST),86		("join", builtin_join::INST),87		("reverse", builtin_reverse::INST),88		("any", builtin_any::INST),89		("all", builtin_all::INST),90		("member", builtin_member::INST),91		("contains", builtin_contains::INST),92		("count", builtin_count::INST),93		("avg", builtin_avg::INST),94		("removeAt", builtin_remove_at::INST),95		("remove", builtin_remove::INST),96		("flattenArrays", builtin_flatten_arrays::INST),97		("flattenDeepArray", builtin_flatten_deep_array::INST),98		("prune", builtin_prune::INST),99		("filterMap", builtin_filter_map::INST),100		// Math101		("abs", builtin_abs::INST),102		("sign", builtin_sign::INST),103		("max", builtin_max::INST),104		("min", builtin_min::INST),105		("sum", builtin_sum::INST),106		("modulo", builtin_modulo::INST),107		("floor", builtin_floor::INST),108		("ceil", builtin_ceil::INST),109		("log", builtin_log::INST),110		("pow", builtin_pow::INST),111		("sqrt", builtin_sqrt::INST),112		("sin", builtin_sin::INST),113		("cos", builtin_cos::INST),114		("tan", builtin_tan::INST),115		("asin", builtin_asin::INST),116		("acos", builtin_acos::INST),117		("atan", builtin_atan::INST),118		("atan2", builtin_atan2::INST),119		("exp", builtin_exp::INST),120		("mantissa", builtin_mantissa::INST),121		("exponent", builtin_exponent::INST),122		("round", builtin_round::INST),123		("isEven", builtin_is_even::INST),124		("isOdd", builtin_is_odd::INST),125		("isInteger", builtin_is_integer::INST),126		("isDecimal", builtin_is_decimal::INST),127		// Operator128		("mod", builtin_mod::INST),129		("primitiveEquals", builtin_primitive_equals::INST),130		("equals", builtin_equals::INST),131		("xor", builtin_xor::INST),132		("xnor", builtin_xnor::INST),133		("format", builtin_format::INST),134		// Sort135		("sort", builtin_sort::INST),136		("uniq", builtin_uniq::INST),137		("set", builtin_set::INST),138		("minArray", builtin_min_array::INST),139		("maxArray", builtin_max_array::INST),140		// Hash141		("md5", builtin_md5::INST),142		("sha1", builtin_sha1::INST),143		("sha256", builtin_sha256::INST),144		("sha512", builtin_sha512::INST),145		("sha3", builtin_sha3::INST),146		// Encoding147		("encodeUTF8", builtin_encode_utf8::INST),148		("decodeUTF8", builtin_decode_utf8::INST),149		("base64", builtin_base64::INST),150		("base64Decode", builtin_base64_decode::INST),151		("base64DecodeBytes", builtin_base64_decode_bytes::INST),152		// Objects153		("objectFieldsEx", builtin_object_fields_ex::INST),154		("objectFields", builtin_object_fields::INST),155		("objectFieldsAll", builtin_object_fields_all::INST),156		("objectValues", builtin_object_values::INST),157		("objectValuesAll", builtin_object_values_all::INST),158		("objectKeysValues", builtin_object_keys_values::INST),159		("objectKeysValuesAll", builtin_object_keys_values_all::INST),160		("objectHasEx", builtin_object_has_ex::INST),161		("objectHas", builtin_object_has::INST),162		("objectHasAll", builtin_object_has_all::INST),163		("objectRemoveKey", builtin_object_remove_key::INST),164		// Manifest165		("escapeStringJson", builtin_escape_string_json::INST),166		("manifestJsonEx", builtin_manifest_json_ex::INST),167		("manifestYamlDoc", builtin_manifest_yaml_doc::INST),168		("manifestTomlEx", builtin_manifest_toml_ex::INST),169		("toString", builtin_to_string::INST),170		// Parsing171		("parseJson", builtin_parse_json::INST),172		("parseYaml", builtin_parse_yaml::INST),173		// Strings174		("codepoint", builtin_codepoint::INST),175		("substr", builtin_substr::INST),176		("char", builtin_char::INST),177		("strReplace", builtin_str_replace::INST),178		("isEmpty", builtin_is_empty::INST),179		("equalsIgnoreCase", builtin_equals_ignore_case::INST),180		("splitLimit", builtin_splitlimit::INST),181		("asciiUpper", builtin_ascii_upper::INST),182		("asciiLower", builtin_ascii_lower::INST),183		("findSubstr", builtin_find_substr::INST),184		("parseInt", builtin_parse_int::INST),185		#[cfg(feature = "exp-bigint")]186		("bigint", builtin_bigint::INST),187		("parseOctal", builtin_parse_octal::INST),188		("parseHex", builtin_parse_hex::INST),189		("stringChars", builtin_string_chars::INST),190		// Misc191		("length", builtin_length::INST),192		("startsWith", builtin_starts_with::INST),193		("endsWith", builtin_ends_with::INST),194		// Sets195		("setMember", builtin_set_member::INST),196		("setInter", builtin_set_inter::INST),197		("setDiff", builtin_set_diff::INST),198		("setUnion", builtin_set_union::INST),199		// Regex200		#[cfg(feature = "exp-regex")]201		("regexQuoteMeta", builtin_regex_quote_meta::INST),202		// Compat203		("__compare", builtin___compare::INST),204	]205	.iter()206	.copied()207	{208		builder.method(name, builtin);209	}210211	builder.method(212		"extVar",213		builtin_ext_var {214			settings: settings.clone(),215		},216	);217	builder.method(218		"native",219		builtin_native {220			settings: settings.clone(),221		},222	);223	builder.method("trace", builtin_trace { settings });224	builder.method("id", FuncVal::Id);225226	#[cfg(feature = "exp-regex")]227	{228		// Regex229		let regex_cache = RegexCache::default();230		builder.method(231			"regexFullMatch",232			builtin_regex_full_match {233				cache: regex_cache.clone(),234			},235		);236		builder.method(237			"regexPartialMatch",238			builtin_regex_partial_match {239				cache: regex_cache.clone(),240			},241		);242		builder.method(243			"regexReplace",244			builtin_regex_replace {245				cache: regex_cache.clone(),246			},247		);248		builder.method(249			"regexGlobalReplace",250			builtin_regex_global_replace { cache: regex_cache },251		);252	};253254	builder.build()255}256257pub trait TracePrinter {258	fn print_trace(&self, loc: CallLocation, value: IStr);259}260261pub struct StdTracePrinter {262	resolver: PathResolver,263}264impl StdTracePrinter {265	pub fn new(resolver: PathResolver) -> Self {266		Self { resolver }267	}268}269impl TracePrinter for StdTracePrinter {270	fn print_trace(&self, loc: CallLocation, value: IStr) {271		eprint!("TRACE:");272		if let Some(loc) = loc.0 {273			let locs = loc.0.map_source_locations(&[loc.1]);274			eprint!(275				" {}:{}",276				loc.0.source_path().path().map_or_else(277					|| loc.0.source_path().to_string(),278					|p| self.resolver.resolve(p)279				),280				locs[0].line281			);282		}283		eprintln!(" {value}");284	}285}286287pub struct Settings {288	/// Used for `std.extVar`289	pub ext_vars: HashMap<IStr, TlaArg>,290	/// Used for `std.native`291	pub ext_natives: HashMap<IStr, FuncVal>,292	/// Used for `std.trace`293	pub trace_printer: Box<dyn TracePrinter>,294	/// Used for `std.thisFile`295	pub path_resolver: PathResolver,296}297298fn extvar_source(name: &str, code: impl Into<IStr>) -> Source {299	let source_name = format!("<extvar:{name}>");300	Source::new_virtual(source_name.into(), code.into())301}302303#[derive(Trace, Clone)]304pub struct ContextInitializer {305	/// When we don't need to support legacy-this-file, we can reuse same context for all files306	#[cfg(not(feature = "legacy-this-file"))]307	context: jrsonnet_evaluator::Context,308	/// For `populate`309	#[cfg(not(feature = "legacy-this-file"))]310	stdlib_thunk: Thunk<Val>,311	/// Otherwise, we can only keep first stdlib layer, and then stack thisFile on top of it312	#[cfg(feature = "legacy-this-file")]313	stdlib_obj: ObjValue,314	settings: Rc<RefCell<Settings>>,315}316impl ContextInitializer {317	pub fn new(s: State, resolver: PathResolver) -> Self {318		let settings = Settings {319			ext_vars: HashMap::new(),320			ext_natives: HashMap::new(),321			trace_printer: Box::new(StdTracePrinter::new(resolver.clone())),322			path_resolver: resolver,323		};324		let settings = Rc::new(RefCell::new(settings));325		let stdlib_obj = stdlib_uncached(settings.clone());326		#[cfg(not(feature = "legacy-this-file"))]327		let stdlib_thunk = Thunk::evaluated(Val::Obj(stdlib_obj));328		#[cfg(feature = "legacy-this-file")]329		let _ = s;330		Self {331			#[cfg(not(feature = "legacy-this-file"))]332			context: {333				let mut context = ContextBuilder::with_capacity(s, 1);334				context.bind("std", stdlib_thunk.clone());335				context.build()336			},337			#[cfg(not(feature = "legacy-this-file"))]338			stdlib_thunk,339			#[cfg(feature = "legacy-this-file")]340			stdlib_obj,341			settings,342		}343	}344	pub fn settings(&self) -> Ref<Settings> {345		self.settings.borrow()346	}347	pub fn settings_mut(&self) -> RefMut<Settings> {348		self.settings.borrow_mut()349	}350	pub fn add_ext_var(&self, name: IStr, value: Val) {351		self.settings_mut()352			.ext_vars353			.insert(name, TlaArg::Val(value));354	}355	pub fn add_ext_str(&self, name: IStr, value: IStr) {356		self.settings_mut()357			.ext_vars358			.insert(name, TlaArg::String(value));359	}360	pub fn add_ext_code(&self, name: &str, code: impl Into<IStr>) -> Result<()> {361		let code = code.into();362		let source = extvar_source(name, code.clone());363		let parsed = jrsonnet_parser::parse(364			&code,365			&jrsonnet_parser::ParserSettings {366				source: source.clone(),367			},368		)369		.map_err(|e| ImportSyntaxError {370			path: source,371			error: Box::new(e),372		})?;373		// self.data_mut().volatile_files.insert(source_name, code);374		self.settings_mut()375			.ext_vars376			.insert(name.into(), TlaArg::Code(parsed));377		Ok(())378	}379	pub fn add_native(&self, name: impl Into<IStr>, cb: impl Into<FuncVal>) {380		self.settings_mut()381			.ext_natives382			.insert(name.into(), cb.into());383	}384}385impl jrsonnet_evaluator::ContextInitializer for ContextInitializer {386	fn reserve_vars(&self) -> usize {387		1388	}389	#[cfg(not(feature = "legacy-this-file"))]390	fn initialize(&self, _s: State, _source: Source) -> jrsonnet_evaluator::Context {391		self.context.clone()392	}393	#[cfg(not(feature = "legacy-this-file"))]394	fn populate(&self, _for_file: Source, builder: &mut ContextBuilder) {395		builder.bind("std", self.stdlib_thunk.clone());396	}397	#[cfg(feature = "legacy-this-file")]398	fn populate(&self, source: Source, builder: &mut ContextBuilder) {399		let mut std = ObjValueBuilder::new();400		std.with_super(self.stdlib_obj.clone());401		std.field("thisFile").hide().value({402			let source_path = source.source_path();403			source_path.path().map_or_else(404				|| source_path.to_string(),405				|p| self.settings().path_resolver.resolve(p),406			)407		});408		let stdlib_with_this_file = std.build();409410		builder.bind("std", Thunk::evaluated(Val::Obj(stdlib_with_this_file)));411	}412	fn as_any(&self) -> &dyn std::any::Any {413		self414	}415}416417pub trait StateExt {418	/// This method was previously implemented in jrsonnet-evaluator itself419	fn with_stdlib(&self);420}421422impl StateExt for State {423	fn with_stdlib(&self) {424		let initializer = ContextInitializer::new(self.clone(), PathResolver::new_cwd_fallback());425		self.settings_mut().context_initializer = tb!(initializer);426	}427}
modifiedcrates/jrsonnet-stdlib/src/regex.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/regex.rs
+++ b/crates/jrsonnet-stdlib/src/regex.rs
@@ -50,16 +50,16 @@
 
 	for ele in captured.iter().skip(1) {
 		if let Some(ele) = ele {
-			captures.push(Val::Str(StrValue::Flat(ele.as_str().into())))
+			captures.push(Val::Str(StrValue::Flat(ele.as_str().into())));
 		} else {
-			captures.push(Val::Str(StrValue::Flat(IStr::empty())))
+			captures.push(Val::Str(StrValue::Flat(IStr::empty())));
 		}
 	}
 	for (i, name) in regex
 		.capture_names()
 		.skip(1)
 		.enumerate()
-		.flat_map(|(i, v)| Some((i, v?)))
+		.filter_map(|(i, v)| Some((i, v?)))
 	{
 		let capture = captures[i].clone();
 		named_captures.field(name).try_value(capture)?;
modifiedflake.lockdiffbeforeafterboth
--- a/flake.lock
+++ b/flake.lock
@@ -7,11 +7,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1711299236,
-        "narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=",
+        "lastModified": 1714536327,
+        "narHash": "sha256-zu4+LcygJwdyFHunTMeDFltBZ9+hoWvR/1A7IEy7ChA=",
         "owner": "ipetkov",
         "repo": "crane",
-        "rev": "880573f80d09e18a11713f402b9e6172a085449f",
+        "rev": "3124551aebd8db15d4560716d4f903bd44c64e4a",
         "type": "github"
       },
       "original": {
@@ -25,11 +25,11 @@
         "systems": "systems"
       },
       "locked": {
-        "lastModified": 1705309234,
-        "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
+        "lastModified": 1710146030,
+        "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
+        "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
         "type": "github"
       },
       "original": {
@@ -40,11 +40,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1705391267,
-        "narHash": "sha256-gGVm9QudiRtYTX8PN9cTTy7uuJcL4I2lRMoPx496kXk=",
+        "lastModified": 1714595735,
+        "narHash": "sha256-8MDOiHrg2mOylcC7wpx1U1mk9V5VranG7wKyenhHnic=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "41a9a7f170c740acb24f3390323877d11c69d5ee",
+        "rev": "9d7a1659bc5c6be24ac46407b91807c6e3e0227d",
         "type": "github"
       },
       "original": {
@@ -71,11 +71,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1705371439,
-        "narHash": "sha256-P1kulUXpYWkcrjiX3sV4j8ACJZh9XXSaaD+jDLBDLKo=",
+        "lastModified": 1714529851,
+        "narHash": "sha256-YMKJW880f7LHXVRzu93xa6Ek+QLECIu0IRQbXbzZe38=",
         "owner": "oxalica",
         "repo": "rust-overlay",
-        "rev": "b21f3c0d5bf0f0179f5f0140e8e0cd099618bd04",
+        "rev": "9ca720fdcf7865385ae3b93ecdf65f1a64cb475e",
         "type": "github"
       },
       "original": {
modifiedrust-toolchain.tomldiffbeforeafterboth
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -1,3 +1,3 @@
 [toolchain]
-channel = "nightly-2024-01-10"
+channel = "nightly-2024-05-10"
 components = ["rustfmt", "clippy", "rust-analyzer", "rust-src"]
modifiedtests/tests/golden.rsdiffbeforeafterboth
--- a/tests/tests/golden.rs
+++ b/tests/tests/golden.rs
@@ -27,11 +27,7 @@
 		Ok(v) => v,
 		Err(e) => return trace_format.format(&e).unwrap(),
 	};
-	match v.manifest(
-		JsonFormat::default(),
-		#[cfg(feature = "exp-preserve-order")]
-		false,
-	) {
+	match v.manifest(JsonFormat::default()) {
 		Ok(v) => v.to_string(),
 		Err(e) => trace_format.format(&e).unwrap(),
 	}
modifiedxtask/src/sourcegen/ast.rsdiffbeforeafterboth
--- a/xtask/src/sourcegen/ast.rs
+++ b/xtask/src/sourcegen/ast.rs
@@ -62,6 +62,7 @@
 
 #[derive(Debug, Clone)]
 pub struct AstTokenEnumSrc {
+	#[allow(dead_code)]
 	pub doc: Vec<String>,
 	pub name: String,
 	pub variants: Vec<String>,
modifiedxtask/src/sourcegen/kinds.rsdiffbeforeafterboth
--- a/xtask/src/sourcegen/kinds.rs
+++ b/xtask/src/sourcegen/kinds.rs
@@ -14,6 +14,7 @@
 	Error {
 		grammar_name: String,
 		name: String,
+		#[allow(dead_code)]
 		/// Is this error returned by lexer directly, or from lex.rs
 		is_lexer_error: bool,
 		regex: Option<String>,