diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 6f0b0fda9..2e774868d 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -4,35 +4,26 @@ on: push: branches: - main - - develop + - next jobs: - deploy: + publish_docs: + name: publish docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - name: Setup mdBook - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: 'latest' - - name: Install mdbook-katex - uses: actions-rs/cargo@v1 - with: - command: install - args: mdbook-katex - - name: Install mdbook-linkcheck - uses: actions-rs/cargo@v1 - with: - command: install - args: mdbook-linkcheck - - name: Build miden book - run: mdbook build docs/ + - uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup update --no-self-update + rustc --version + - name: Install cargo-make + run: | + cargo install cargo-make --force + - name: Build + run: | + cargo make docs - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/book/html + publish_dir: ./target/docs/site diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98451e6ad..6d3ef949d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,132 +4,152 @@ on: push: branches: - main + - next paths-ignore: - "*.md" + - "*.txt" + - "docs" pull_request: paths-ignore: - "*.md" - -env: - CARGO_MAKE_TOOLCHAIN: nightly-2024-05-07 + - "*.txt" + - "docs" jobs: - compiler: + lint: + name: lint runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} - override: true + run: | + rustup update --no-self-update + rustc --version - name: Cache Cargo - uses: actions/cache@v2 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} + # Use a common cache for the basic compilation/formatter/clippy checks + shared-key: ${{ github.workflow }}-shared + save-if: ${{ github.ref == 'refs/heads/next' }} - name: Install cargo-make - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-make - - name: Build - uses: actions-rs/cargo@v1 - with: - command: make - args: build - - name: Test - uses: actions-rs/cargo@v1 - with: - command: make - args: test -E 'not package(cargo-miden)' + run: | + if ! cargo make --version 2>/dev/null; then + cargo install cargo-make --force + fi + - name: Clippy + run: | + cargo make clippy - cargo_miden_test_clean_env: - # Run cargo-miden test in the clean env to simulate user's first run. - # To test the installation of the required dependencies (e.g. rust-src, wasm target, etc.) - name: cargo-miden tests + check_format: + name: check formatting runs-on: ubuntu-latest - + # Run this job after the linter, so the cache is hot + needs: [lint] + # But run this check even if the lint check failed + if: ${{ always() }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} - override: true + run: | + rustup update --no-self-update + rustc --version - name: Cache Cargo - uses: actions/cache@v2 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} + # Use a common cache for the basic compilation/formatter/clippy checks + shared-key: ${{ github.workflow }}-shared + # But do not save this cache, just use it + save-if: false - name: Install cargo-make - uses: actions-rs/cargo@v1 + run: | + if ! cargo make --version 2>/dev/null; then + cargo install cargo-make --force + fi + - name: Check Formatting + run: | + cargo make check-format + + unit_tests: + name: midenc unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup update --no-self-update + rustc --version + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 with: - command: install - args: cargo-make + # NOTE: We use a different cache for the tests, so they can be run in parallel, but we + # also share the cache for the tests for efficiency + shared-key: ${{ github.workflow }}-shared-tests + save-if: ${{ github.ref == 'refs/heads/next' }} + - name: Install cargo-make + run: | + if ! cargo make --version 2>/dev/null; then + cargo install cargo-make --force + fi + - name: Check + # We run `cargo check` to verify that the workspace compiles correctly before attempting + # to execute the tests from each crate. This produces easier to read output if a compilation + # error occurs + run: | + cargo make check --tests - name: Test - uses: actions-rs/cargo@v1 - with: - command: make - args: test -E 'package(cargo-miden)' + run: | + cargo make test -E 'not (package(miden-integration-tests) or package(cargo-miden))' - clippy: - name: clippy + midenc_integration_tests: + name: midenc integration tests runs-on: ubuntu-latest + # We only want to run the integration tests if the unit tests pass, and that has the added + # benefit that we can re-use the cache from the unit test job for all integration tests + needs: [unit_tests] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} - override: true + run: | + rustup update --no-self-update + rustc --version - name: Cache Cargo - uses: actions/cache@v2 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} + shared-key: ${{ github.workflow }}-shared-tests + # Do not persist the cache, leave that to the unit tests, we just use the cache here + save-if: false - name: Install cargo-make - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-make - - name: Run clippy - uses: actions-rs/cargo@v1 - with: - command: make - args: clippy + run: | + if ! cargo make --version 2>/dev/null; then + cargo install cargo-make --force + fi + - name: Test + run: | + cargo make test -E 'package(miden-integration-tests)' - rustfmt: - name: rustfmt + cargo_miden_integration_tests: + name: cargo-miden integration tests runs-on: ubuntu-latest + # We only want to run the integration tests if the unit tests pass, and that has the added + # benefit that we can re-use the cache from the unit test job for all integration tests + needs: [unit_tests] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} - override: true + run: | + rustup update --no-self-update + rustc --version - name: Cache Cargo - uses: actions/cache@v2 + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} + shared-key: ${{ github.workflow }}-shared-tests + # Do not persist the cache, leave that to the unit tests, we just use the cache here + save-if: false - name: Install cargo-make - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-make - - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: make - args: check-format + run: | + if ! cargo make --version 2>/dev/null; then + cargo install cargo-make --force + fi + - name: Test + run: | + cargo make test -E 'package(cargo-miden)' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 238b3c9dd..478f30866 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,10 @@ -# Runs `release-plz release` only after the release PR (starts with `release-plz-`) -# is merged to the next branch. See `release_always = false` in `release-plz.toml` +# Runs `release-plz release` only after the release PR (starts with `release-plz-`) +# is merged to the next branch. See `release_always = false` in `release-plz.toml` # Publishes any unpublished crates when. # Does nothing if all crates are already published (i.e. have their versions on crates.io). # Does not create/update release PRs. # The crate version bumping and changelog generation is done via the `release-plz update` CLI command. -# Then manually create a release PR(starts with `release-plz-`) with the proposed changes and +# Then manually create a release PR(starts with `release-plz-`) with the proposed changes and # when the PR is merged this action will publish the crates. # See CONTRIBUTING.md for more details. @@ -15,33 +15,27 @@ on: branches: - next -env: - CARGO_MAKE_TOOLCHAIN: nightly-2024-05-07 - jobs: release-plz: name: release-plz runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} - override: true - - name: Cache Cargo - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} - - name: Publish Miden compiler crates - uses: MarcoIeni/release-plz-action@v0.5 - with: - # Only run the `release` command that publishes any unpublished crates. - command: release - # `manifest_path` is omitted because it defaults to the root directory - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + - uses: actions/checkout@v4 + - name: Install Rust + run: | + rustup update --no-self-update + rustc --version + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/next' }} + - name: Publish + uses: MarcoIeni/release-plz-action@v0.5 + with: + # Only run the `release` command that publishes any unpublished crates. + command: release + # `manifest_path` is omitted because it defaults to the root directory + # manifest_path: "..." + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.gitignore b/.gitignore index 4beda79c0..bfe20b171 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,15 @@ bin/midenc bin/litcheck .crates.toml .crates2.json + +# Docs platform ignores +.vscode +.code +.idea +site/ +venv/ +env/ +*.out +node_modules/ +*DS_Store +*.iml \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f963aca7..7c5dd3904 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,7 @@ TBD ### Prerequisites Install `release-plz` CLI tool following the instructions [here](https://release-plz.ieni.dev/docs/usage/installation) +Install `cargo-semver-checks` CLI tool [here](https://github.com/obi1kenobi/cargo-semver-checks#installation) to use as an extra check in `release-plz` and bump the major versions on semver violations. ### Release of the Miden Compiler and Miden SDK crates diff --git a/Cargo.lock b/Cargo.lock index 93262ae1e..1690530e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,19 +8,10 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ - "lazy_static", + "lazy_static 1.5.0", "regex", ] -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli 0.29.0", -] - [[package]] name = "addr2line" version = "0.24.1" @@ -29,7 +20,7 @@ checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "cpp_demangle", "fallible-iterator", - "gimli 0.31.0", + "gimli", "memmap2", "object", "rustc-demangle", @@ -38,10 +29,10 @@ dependencies = [ ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aes" @@ -107,6 +98,15 @@ dependencies = [ "libc", ] +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + [[package]] name = "anstream" version = "0.6.15" @@ -158,9 +158,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "anymap2" @@ -176,9 +176,15 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "as-slice" @@ -222,13 +228,13 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-lite 2.3.0", "slab", ] @@ -267,9 +273,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ "async-lock 3.4.0", "cfg-if", @@ -277,11 +283,11 @@ dependencies = [ "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.2", - "rustix 0.38.34", + "polling 3.7.3", + "rustix 0.38.37", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -317,7 +323,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.34", + "rustix 0.38.37", "windows-sys 0.48.0", ] @@ -329,25 +335,25 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "async-signal" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.3", + "async-io 2.3.4", "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix 0.38.37", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -358,13 +364,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -373,6 +379,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "auth-git2" version = "0.5.4" @@ -392,17 +409,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.22.0", - "cc", + "addr2line", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -456,7 +473,7 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] @@ -480,10 +497,10 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee1bce7608560cd4bf0296a4262d0dbf13e6bcec5ff2105724c8ab88cc7fc784" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "bytemuck", "glam", - "serde", + "serde 1.0.210", ] [[package]] @@ -498,14 +515,23 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.6", "cc", "cfg-if", "constant_time_eq", @@ -550,7 +576,7 @@ checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "regex-automata 0.4.7", - "serde", + "serde 1.0.210", ] [[package]] @@ -561,9 +587,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -573,24 +599,24 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] name = "cargo-component" -version = "0.6.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6b160653aa2faac6c572d7e6e90c78c1fb2c043ac08e2c32db47fd5bd8ae1e" +checksum = "deedd1f20ddb574d9d198d979499f628f2865718190830523cb329e264ef1469" dependencies = [ "anyhow", "bytes", @@ -599,8 +625,8 @@ dependencies = [ "cargo_metadata", "clap", "futures", - "heck 0.4.1", - "indexmap 2.2.6", + "heck 0.5.0", + "indexmap 2.5.0", "libc", "log", "p256", @@ -609,61 +635,62 @@ dependencies = [ "rand_core", "rpassword", "semver 1.0.23", - "serde", + "serde 1.0.210", "serde_json", + "shell-escape", + "tempfile", "tokio", "tokio-util", - "toml_edit 0.21.1", + "toml_edit 0.22.20", "url", - "warg-client", - "warg-crypto", - "warg-protocol", - "wasm-metadata", - "which 5.0.0", + "wasi-preview1-component-adapter-provider", + "wasm-metadata 0.215.0", + "wasm-pkg-client", + "wasmparser 0.215.0", + "which", "wit-bindgen-core", "wit-bindgen-rust", - "wit-component 0.19.1", - "wit-parser", + "wit-component 0.215.0", + "wit-parser 0.215.0", ] [[package]] name = "cargo-component-core" -version = "0.6.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde709273523be5af0e052c0e968e83988010fe8f34d9013a0e13255ac2e2da3" +checksum = "2942b6673d038ed6da6c7a5964372c540253dee1508c55b0f5f7614fb2c6c371" dependencies = [ "anyhow", "clap", + "dirs", "futures", - "indexmap 2.2.6", - "keyring", + "indexmap 2.5.0", "libc", "log", "owo-colors", "semver 1.0.23", - "serde", + "serde 1.0.210", "tokio", - "toml_edit 0.21.1", + "tokio-util", + "toml_edit 0.22.20", "unicode-width", "url", - "warg-client", - "warg-crypto", - "warg-protocol", + "wasm-pkg-client", "windows-sys 0.52.0", - "wit-component 0.19.1", - "wit-parser", + "wit-component 0.215.0", + "wit-parser 0.215.0", ] [[package]] name = "cargo-config2" -version = "0.1.26" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83ce0be8bd1479e5de6202def660e6c7e27e4e0599bffa4fed05bd380ec2ede" +checksum = "1124054becb9262cc15c5e96e82f0d782f2aed3a3034d1f71a6385a6fa9e9595" dependencies = [ "home", - "serde", + "serde 1.0.210", "serde_derive", - "toml_edit 0.22.18", + "toml_edit 0.22.20", ] [[package]] @@ -685,7 +712,7 @@ dependencies = [ "heck 0.5.0", "home", "ignore", - "indexmap 2.2.6", + "indexmap 2.5.0", "indicatif", "liquid", "liquid-core", @@ -700,17 +727,17 @@ dependencies = [ "rhai", "sanitize-filename", "semver 1.0.23", - "serde", + "serde 1.0.210", "tempfile", "thiserror", "time", - "toml", + "toml 0.8.19", "walkdir", ] [[package]] name = "cargo-miden" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "cargo-component", @@ -733,14 +760,14 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] name = "cargo-util" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14104698cb1694d43c2ff73492468ccf2bb0b047071a9838d999eeba9e984ffa" +checksum = "cc680c90073156fb5280c0c0127b779eef1f6292e41f7d6621acba3041e81c7d" dependencies = [ "anyhow", "core-foundation", @@ -768,7 +795,7 @@ dependencies = [ "camino", "cargo-platform", "semver 1.0.23", - "serde", + "serde 1.0.210", "serde_json", "thiserror", ] @@ -799,12 +826,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.7" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -827,8 +855,10 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", - "num-traits", - "serde", + "js-sys", + "num-traits 0.2.19", + "serde 1.0.210", + "wasm-bindgen", "windows-targets 0.52.6", ] @@ -844,9 +874,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.11" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -854,9 +884,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -867,14 +897,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -910,7 +940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -922,6 +952,22 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "config" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +dependencies = [ + "lazy_static 1.5.0", + "nom", + "rust-ini", + "serde 1.0.210", + "serde-hjson", + "serde_json", + "toml 0.5.11", + "yaml-rust", +] + [[package]] name = "console" version = "0.15.8" @@ -929,7 +975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", - "lazy_static", + "lazy_static 1.5.0", "libc", "unicode-width", "windows-sys 0.52.0", @@ -963,9 +1009,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "convert_case" @@ -985,24 +1031,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpp_demangle" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ "cfg-if", ] [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1067,7 +1113,7 @@ dependencies = [ "futures-core", "mio", "parking_lot", - "rustix 0.38.34", + "rustix 0.38.37", "signal-hook", "signal-hook-mio", "winapi", @@ -1140,7 +1186,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1151,7 +1197,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1172,7 +1218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", + "serde 1.0.210", ] [[package]] @@ -1195,8 +1241,8 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.72", + "rustc_version 0.4.1", + "syn 2.0.77", ] [[package]] @@ -1230,13 +1276,22 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys 0.3.7", +] + [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", ] [[package]] @@ -1249,6 +1304,17 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -1284,6 +1350,17 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "docker_credential" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31951f49556e34d90ed28342e1df7e1cb7a229c4cab0aecc627b5d91edd41d07" +dependencies = [ + "base64 0.21.7", + "serde 1.0.210", + "serde_json", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -1355,7 +1432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", - "serde", + "serde 1.0.210", ] [[package]] @@ -1366,7 +1443,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1492,9 +1569,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1508,14 +1585,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -1526,9 +1603,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide", @@ -1540,21 +1617,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1656,7 +1718,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-core", "futures-io", "parking", @@ -1671,7 +1733,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -1706,9 +1768,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979f00864edc7516466d6b3157706e06c032f22715700ddd878228a91d02bc56" +checksum = "dbb949699c3e4df3a183b1d2142cb24277057055ed23c68ed58894f76c517223" dependencies = [ "cfg-if", "libc", @@ -1739,12 +1801,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - [[package]] name = "gimli" version = "0.31.0" @@ -1781,7 +1837,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror", - "winnow 0.6.16", + "winnow 0.6.18", ] [[package]] @@ -1802,7 +1858,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow 0.6.16", + "winnow 0.6.18", ] [[package]] @@ -1851,7 +1907,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "gix-features", "gix-utils", ] @@ -1905,14 +1961,14 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow 0.6.16", + "winnow 0.6.18", ] [[package]] name = "gix-path" -version = "0.10.10" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d5b8722112fa2fa87135298780bc833b0e9f6c56cc82795d209804b3a03484" +checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" dependencies = [ "bstr", "gix-trace", @@ -1939,7 +1995,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow 0.6.16", + "winnow 0.6.18", ] [[package]] @@ -1969,9 +2025,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" +checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" [[package]] name = "gix-utils" @@ -1979,7 +2035,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.1.1", "unicode-normalization", ] @@ -2007,9 +2063,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", @@ -2031,17 +2087,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.26" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2062,7 +2118,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", - "serde", + "serde 1.0.210", ] [[package]] @@ -2070,9 +2126,6 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -2080,6 +2133,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.9" @@ -2127,23 +2189,44 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", "itoa", ] +[[package]] +name = "http-auth" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "150fa4a9462ef926824cf4519c84ed652ca8f4fbae34cb8af045b5cbcaf98822" +dependencies = [ + "memchr", +] + [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", + "futures-util", "http", + "http-body", "pin-project-lite", ] @@ -2153,12 +2236,6 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "human-panic" version = "2.0.1" @@ -2169,9 +2246,9 @@ dependencies = [ "anstyle", "backtrace", "os_info", - "serde", + "serde 1.0.210", "serde_derive", - "toml", + "toml 0.8.19", "uuid", ] @@ -2183,39 +2260,60 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.7", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + +[[package]] +name = "hyper-util" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", "hyper", - "native-tls", + "pin-project-lite", + "socket2 0.5.7", "tokio", - "tokio-native-tls", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -2265,9 +2363,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" dependencies = [ "crossbeam-deque", "globset", @@ -2279,6 +2377,20 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "im-rc" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" +dependencies = [ + "bitmaps", + "rand_core", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + [[package]] name = "indenter" version = "0.3.3" @@ -2293,18 +2405,18 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", + "serde 1.0.210", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", - "serde", + "serde 1.0.210", ] [[package]] @@ -2337,7 +2449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b23a0c8dfe501baac4adf6ebbfa6eddf8f0c07f56b058cc1288017e32397846c" dependencies = [ "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2351,9 +2463,9 @@ dependencies = [ [[package]] name = "intrusive-collections" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b694dc9f70c3bda874626d2aed13b780f137aab435f4e9814121955cf706122e" +checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86" dependencies = [ "memoffset 0.9.1", ] @@ -2377,17 +2489,17 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] @@ -2406,18 +2518,18 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -2439,25 +2551,25 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jiff" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437651126da47900d4d70255ab15f5c69510ca4e0d88c9f01b5b8d41a45c3a9b" +checksum = "8a45489186a6123c128fdf6016183fcfab7113e1820eb813127e036e287233fb" dependencies = [ "jiff-tzdb-platform", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "jiff-tzdb" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05fac328b3df1c0f18a3c2ab6cb7e06e4e549f366017d796e3e66b6d6889abe6" +checksum = "91335e575850c5c4c673b9bd467b0e025f164ca59d0564f69d0c2ee0ffad4653" [[package]] name = "jiff-tzdb-platform" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8da387d5feaf355954c2c122c194d6df9c57d865125a67984bb453db5336940" +checksum = "9835f0060a626fe59f160437bc725491a6af23133ea906500027d1bd2f8f4329" dependencies = [ "jiff-tzdb", ] @@ -2473,13 +2585,28 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jwt" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" +dependencies = [ + "base64 0.13.1", + "crypto-common", + "digest", + "hmac", + "serde 1.0.210", + "serde_json", + "sha2", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2496,7 +2623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "363387f0019d714aa60cc30ab4fe501a747f4c08fc58f069dd14be971bd495a0" dependencies = [ "byteorder", - "lazy_static", + "lazy_static 1.5.0", "linux-keyutils", "secret-service", "security-framework", @@ -2509,7 +2636,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1" dependencies = [ - "serde", + "serde 1.0.210", "static_assertions", ] @@ -2543,6 +2670,12 @@ dependencies = [ "regex-automata 0.4.7", ] +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" + [[package]] name = "lazy_static" version = "1.5.0" @@ -2555,11 +2688,24 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags 1.3.2", + "cfg-if", + "ryu", + "static_assertions", +] + [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libgit2-sys" @@ -2589,6 +2735,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -2607,9 +2754,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "libc", @@ -2647,51 +2794,51 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "liquid" -version = "0.26.8" +version = "0.26.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9338405fdbc0bce9b01695b2a2ef6b20eca5363f385d47bce48ddf8323cc25" +checksum = "7cdcc72b82748f47c2933c172313f5a9aea5b2c4eb3fa4c66b4ea55bb60bb4b1" dependencies = [ "doc-comment", "liquid-core", "liquid-derive", "liquid-lib", - "serde", + "serde 1.0.210", ] [[package]] name = "liquid-core" -version = "0.26.8" +version = "0.26.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb8fed70857010ed9016ed2ce5a7f34e7cc51d5d7255c9c9dc2e3243e490b42" +checksum = "2752e978ffc53670f3f2e8b3ef09f348d6f7b5474a3be3f8a5befe5382e4effb" dependencies = [ "anymap2", "itertools 0.13.0", "kstring", "liquid-derive", - "num-traits", + "num-traits 0.2.19", "pest", "pest_derive", "regex", - "serde", + "serde 1.0.210", "time", ] [[package]] name = "liquid-derive" -version = "0.26.7" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5aa659a76b649f0d639ef0b9c067a9499c42a9d7f3e7832e279f791704966" +checksum = "3b51f1d220e3fa869e24cfd75915efe3164bd09bb11b3165db3f37f57bf673e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "liquid-lib" -version = "0.26.8" +version = "0.26.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1794b5605e9f8864a8a4f41aa97976b42512cc81093f8c885d29fb94c6c556" +checksum = "59b1a298d3d2287ee5b1e43840d885b8fdfc37d3f4e90d82aacfd04d021618da" dependencies = [ "itertools 0.13.0", "liquid-core", @@ -2720,32 +2867,33 @@ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "logos" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c000ca4d908ff18ac99b93a062cb8958d331c3220719c52e77cb19cc6ac5d2c1" +checksum = "ff1ceb190eb9bdeecdd8f1ad6a71d6d632a50905948771718741b5461fb01e13" dependencies = [ "logos-derive", ] [[package]] name = "logos-codegen" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc487311295e0002e452025d6b580b77bb17286de87b57138f3b5db711cded68" +checksum = "90be66cb7bd40cb5cc2e9cfaf2d1133b04a3d93b72344267715010a466e0915a" dependencies = [ "beef", "fnv", + "lazy_static 1.5.0", "proc-macro2", "quote", - "regex-syntax 0.6.29", - "syn 2.0.72", + "regex-syntax 0.8.4", + "syn 2.0.77", ] [[package]] name = "logos-derive" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfc0d229f1f42d790440136d941afd806bc9e949e2bcb8faa813b0f00d1267e" +checksum = "45154231e8e96586b39494029e58f12f8ffcb5ecf80333a603a13aa205ea8cbd" dependencies = [ "logos-codegen", ] @@ -2789,9 +2937,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -2838,7 +2986,7 @@ dependencies = [ "miden-core", "miden-miette", "miden-thiserror", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "smallvec", "tracing", "unicode-width", @@ -2846,7 +2994,7 @@ dependencies = [ [[package]] name = "miden-base-sys" -version = "0.0.5" +version = "0.0.7" dependencies = [ "miden-assembly", "miden-stdlib-sys", @@ -2866,7 +3014,7 @@ dependencies = [ "miden-miette", "miden-thiserror", "num-derive", - "num-traits", + "num-traits 0.2.19", "parking_lot", "winter-math", "winter-utils", @@ -2902,10 +3050,11 @@ dependencies = [ [[package]] name = "miden-integration-tests" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "blake3", + "cargo-miden", "cargo-util", "cargo_metadata", "concat-idents", @@ -2948,7 +3097,7 @@ dependencies = [ "cfg-if", "futures", "indenter", - "lazy_static", + "lazy_static 1.5.0", "miden-miette-derive", "miden-thiserror", "owo-colors", @@ -2961,7 +3110,7 @@ dependencies = [ "supports-color", "supports-hyperlinks", "supports-unicode", - "syn 2.0.72", + "syn 2.0.77", "terminal_size", "textwrap", "trybuild", @@ -2976,7 +3125,7 @@ checksum = "1cc759f0a2947acae217a2f32f722105cacc57d17d5f93bc16362142943a4edd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -2993,7 +3142,7 @@ dependencies = [ [[package]] name = "miden-sdk" -version = "0.0.5" +version = "0.0.7" dependencies = [ "miden-base-sys", "miden-sdk-alloc", @@ -3002,7 +3151,7 @@ dependencies = [ [[package]] name = "miden-sdk-alloc" -version = "0.0.5" +version = "0.0.7" [[package]] name = "miden-stdlib" @@ -3015,7 +3164,7 @@ dependencies = [ [[package]] name = "miden-stdlib-sys" -version = "0.0.5" +version = "0.0.7" [[package]] name = "miden-thiserror" @@ -3034,12 +3183,12 @@ checksum = "0ee4176a0f2e7d29d2a8ee7e60b6deb14ce67a20e94c3e2c7275cdb8804e1862" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "midenc" -version = "0.0.5" +version = "0.0.7" dependencies = [ "env_logger 0.11.5", "human-panic", @@ -3048,7 +3197,7 @@ dependencies = [ [[package]] name = "midenc-codegen-masm" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "bitcode", @@ -3069,15 +3218,15 @@ dependencies = [ "paste", "petgraph", "proptest", - "rustc-hash", - "serde", + "rustc-hash 1.1.0", + "serde 1.0.210", "serde_bytes", "smallvec", ] [[package]] name = "midenc-compile" -version = "0.0.5" +version = "0.0.7" dependencies = [ "clap", "either", @@ -3097,7 +3246,7 @@ dependencies = [ [[package]] name = "midenc-debug" -version = "0.0.5" +version = "0.0.7" dependencies = [ "clap", "crossterm", @@ -3114,18 +3263,18 @@ dependencies = [ "midenc-session", "proptest", "ratatui", - "serde", + "serde 1.0.210", "signal-hook", "syntect", "tokio", "tokio-util", - "toml", + "toml 0.8.19", "tui-input", ] [[package]] name = "midenc-driver" -version = "0.0.5" +version = "0.0.7" dependencies = [ "clap", "log", @@ -3138,21 +3287,21 @@ dependencies = [ [[package]] name = "midenc-frontend-wasm" -version = "0.0.5" +version = "0.0.7" dependencies = [ - "addr2line 0.24.1", + "addr2line", "anyhow", "derive_more", "expect-test", - "gimli 0.31.0", - "indexmap 2.2.6", + "gimli", + "indexmap 2.5.0", "log", "miden-core", "miden-thiserror", "midenc-hir", "midenc-hir-type", "midenc-session", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", "wasmparser 0.214.0", "wat", @@ -3160,13 +3309,13 @@ dependencies = [ [[package]] name = "midenc-hir" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "cranelift-entity", "derive_more", "either", - "indexmap 2.2.6", + "indexmap 2.5.0", "intrusive-collections", "inventory", "lalrpop", @@ -3180,13 +3329,13 @@ dependencies = [ "midenc-hir-type", "midenc-session", "num-bigint", - "num-traits", + "num-traits 0.2.19", "paste", "petgraph", "pretty_assertions", "rustc-demangle", - "rustc-hash", - "serde", + "rustc-hash 1.1.0", + "serde 1.0.210", "serde_bytes", "serde_repr", "smallvec", @@ -3196,7 +3345,7 @@ dependencies = [ [[package]] name = "midenc-hir-analysis" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "cranelift-bforest", @@ -3207,33 +3356,33 @@ dependencies = [ "midenc-hir", "midenc-session", "pretty_assertions", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", ] [[package]] name = "midenc-hir-macros" -version = "0.0.5" +version = "0.0.7" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "midenc-hir-symbol" -version = "0.0.5" +version = "0.0.7" dependencies = [ "Inflector", - "rustc-hash", - "serde", - "toml", + "rustc-hash 1.1.0", + "serde 1.0.210", + "toml 0.8.19", ] [[package]] name = "midenc-hir-transform" -version = "0.0.5" +version = "0.0.7" dependencies = [ "anyhow", "inventory", @@ -3242,22 +3391,22 @@ dependencies = [ "midenc-hir-analysis", "midenc-session", "pretty_assertions", - "rustc-hash", + "rustc-hash 1.1.0", "smallvec", ] [[package]] name = "midenc-hir-type" -version = "0.0.5" +version = "0.0.7" dependencies = [ - "serde", + "serde 1.0.210", "serde_repr", "smallvec", ] [[package]] name = "midenc-session" -version = "0.0.5" +version = "0.0.7" dependencies = [ "clap", "inventory", @@ -3270,32 +3419,32 @@ dependencies = [ "midenc-hir-macros", "midenc-hir-symbol", "parking_lot", - "serde", + "serde 1.0.210", "serde_repr", "termcolor", ] [[package]] name = "miette" -version = "5.10.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ + "cfg-if", "miette-derive", - "once_cell", "thiserror", "unicode-width", ] [[package]] name = "miette-derive" -version = "5.10.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3306,18 +3455,18 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -3337,9 +3486,9 @@ dependencies = [ [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "names" @@ -3350,23 +3499,6 @@ dependencies = [ "rand", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -3397,13 +3529,24 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + [[package]] name = "normpath" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" +checksum = "c8911957c4b1549ac0dc74e30db9c8b0e66ddcd6d7acc33098f4c63a64a6d7ed" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3427,7 +3570,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational", - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -3437,7 +3580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -3446,7 +3589,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -3463,7 +3606,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -3472,7 +3615,7 @@ version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -3483,7 +3626,7 @@ checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.19", ] [[package]] @@ -3494,7 +3637,16 @@ checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ "num-bigint", "num-integer", - "num-traits", + "num-traits 0.2.19", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.19", ] [[package]] @@ -3515,15 +3667,68 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.36.2" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "flate2", "memchr", "ruzstd", ] +[[package]] +name = "oci-client" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f5098b86f972ac3484f7c9011bbbbd64aaa7e21d10d2c1a91fefb4ad0ba2ad9" +dependencies = [ + "bytes", + "chrono", + "futures-util", + "http", + "http-auth", + "jwt", + "lazy_static 1.5.0", + "olpc-cjson", + "regex", + "reqwest", + "serde 1.0.210", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tracing", + "unicase", +] + +[[package]] +name = "oci-wasm" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3493d1985a31c5fbd4b37f72a319aab88b55908185a5a799219c6152e9da9b" +dependencies = [ + "anyhow", + "chrono", + "oci-client", + "serde 1.0.210", + "serde_json", + "sha2", + "tokio", + "wit-component 0.215.0", + "wit-parser 0.215.0", +] + +[[package]] +name = "olpc-cjson" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d637c9c15b639ccff597da8f4fa968300651ad2f1e968aefc3b4927a6fb2027a" +dependencies = [ + "serde 1.0.210", + "serde_json", + "unicode-normalization", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -3552,32 +3757,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -3602,6 +3781,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits 0.2.19", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -3619,7 +3807,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ "log", - "serde", + "serde 1.0.210", "windows-sys 0.52.0", ] @@ -3631,9 +3819,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "p256" @@ -3649,9 +3837,9 @@ dependencies = [ [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -3671,7 +3859,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -3714,31 +3902,31 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pbjson" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" dependencies = [ - "base64 0.13.1", - "serde", + "base64 0.21.7", + "serde 1.0.210", ] [[package]] name = "pbjson-build" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" dependencies = [ "heck 0.4.1", - "itertools 0.10.5", + "itertools 0.11.0", "prost", "prost-types", ] [[package]] name = "pbjson-types" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" dependencies = [ "bytes", "chrono", @@ -3746,7 +3934,7 @@ dependencies = [ "pbjson-build", "prost", "prost-build", - "serde", + "serde 1.0.210", ] [[package]] @@ -3766,9 +3954,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "9c73c26c01b8c87956cea613c907c9d6ecffd8d18a2a5908e5de0adfaa185cea" dependencies = [ "memchr", "thiserror", @@ -3777,9 +3965,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "664d22978e2815783adbdd2c588b455b1bd625299ce36b2a99881ac9627e6d8d" dependencies = [ "pest", "pest_generator", @@ -3787,22 +3975,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "a2d5487022d5d33f4c30d91c22afa240ce2a644e87fe08caad974d4eab6badbe" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "0091754bbd0ea592c4deb3a122ce8ecbb0753b738aa82bc055fcc2eccc8d8174" dependencies = [ "once_cell", "pest", @@ -3816,7 +4004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.5.0", ] [[package]] @@ -3828,6 +4016,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -3842,12 +4050,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.1.1", "futures-io", ] @@ -3885,17 +4093,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.2" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.37", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3912,12 +4120,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2288c0e17cc8d342c712bb43a257a80ebffce59cdb33d5000d8348f3ec02528b" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ "zerocopy", - "zerocopy-derive", ] [[package]] @@ -3948,12 +4155,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -3999,8 +4206,8 @@ dependencies = [ "bit-set", "bit-vec", "bitflags 2.6.0", - "lazy_static", - "num-traits", + "lazy_static 1.5.0", + "num-traits 0.2.19", "rand", "rand_chacha", "rand_xorshift", @@ -4012,9 +4219,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -4022,44 +4229,43 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", - "heck 0.4.1", - "itertools 0.10.5", - "lazy_static", + "heck 0.5.0", + "itertools 0.12.1", "log", "multimap", + "once_cell", "petgraph", "prettyplease", "prost", "prost-types", "regex", - "syn 1.0.109", + "syn 2.0.77", "tempfile", - "which 4.4.2", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "prost-reflect" -version = "0.11.5" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b823de344848e011658ac981009100818b322421676740546f8b52ed5249428" +checksum = "6f5eec97d5d34bdd17ad2db2219aabf46b054c6c41bd5529767c9ce55be5898f" dependencies = [ "logos", "miette", @@ -4070,18 +4276,18 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] [[package]] name = "protox" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a5aacd1f6147ceac5e3896e0c766187dc6a9645f3b93ec821fabbaf821b887" +checksum = "ac532509cee918d40f38c3e12f8ef9230f215f017d54de7dd975015538a42ce7" dependencies = [ "bytes", "miette", @@ -4094,9 +4300,9 @@ dependencies = [ [[package]] name = "protox-parse" -version = "0.4.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30fc6d0af2dec2c39da31eb02cc78cbc05b843b04f30ad78ccc6e8a342ec5518" +checksum = "7f6c33f43516fe397e2f930779d720ca12cd057f7da4cd6326a0ef78d69dee96" dependencies = [ "logos", "miette", @@ -4104,17 +4310,81 @@ dependencies = [ "thiserror", ] +[[package]] +name = "ptree" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0de80796b316aec75344095a6d2ef68ec9b8f573b9e7adc821149ba3598e270" +dependencies = [ + "ansi_term", + "atty", + "config", + "directories", + "petgraph", + "serde 1.0.210", + "serde-value", + "tint", +] + [[package]] name = "quick-error" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls", + "socket2 0.5.7", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash 2.0.0", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -4158,11 +4428,20 @@ dependencies = [ "rand_core", ] +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + [[package]] name = "ratatui" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba6a365afbe5615999275bea2446b970b10a41102500e27ce7678d50d978303" +checksum = "fdef7f9be5c0122f890d58bdf4d964349ba6a6161f705907526d891efabba57d" dependencies = [ "bitflags 2.6.0", "cassowary", @@ -4181,27 +4460,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -4210,9 +4480,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -4268,11 +4538,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", @@ -4280,24 +4550,29 @@ dependencies = [ "h2", "http", "http-body", + "http-body-util", "hyper", - "hyper-tls", + "hyper-rustls", + "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", - "serde", + "rustls-pki-types", + "serde 1.0.210", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", + "tokio-socks", "tokio-util", "tower-service", "url", @@ -4305,7 +4580,8 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg", + "webpki-roots", + "windows-registry", ] [[package]] @@ -4327,7 +4603,7 @@ dependencies = [ "ahash", "bitflags 2.6.0", "instant", - "num-traits", + "num-traits 0.2.19", "once_cell", "rhai_codegen", "smallvec", @@ -4343,7 +4619,22 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -4367,6 +4658,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -4379,6 +4676,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.2.3" @@ -4390,9 +4693,9 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver 1.0.23", ] @@ -4413,9 +4716,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -4424,13 +4727,45 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -4453,11 +4788,10 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5022b253619b1ba797f243056276bed8ed1a73b0f5a7ce7225d524067644bf8f" +checksum = "99c3938e133aac070997ddc684d4b393777d293ba170f2988c8fd5ea2ad4ce21" dependencies = [ - "byteorder", "twox-hash", ] @@ -4482,19 +4816,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ed72fbaf78e6f2d41744923916966c4fbe3d7c74e3037a8ee482f1115572603" dependencies = [ - "lazy_static", + "lazy_static 1.5.0", "regex", ] -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "scoped-tls" version = "1.0.1" @@ -4527,6 +4852,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" dependencies = [ + "serde 1.0.210", "zeroize", ] @@ -4544,7 +4870,7 @@ dependencies = [ "num", "once_cell", "rand", - "serde", + "serde 1.0.210", "sha2", "zbus", ] @@ -4587,7 +4913,7 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] @@ -4598,43 +4924,71 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.208" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + +[[package]] +name = "serde" +version = "1.0.210" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hjson" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" +dependencies = [ + "lazy_static 1.5.0", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde 1.0.210", +] + [[package]] name = "serde_bytes" version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", "ryu", - "serde", + "serde 1.0.210", ] [[package]] @@ -4645,7 +4999,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4654,7 +5008,7 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] @@ -4666,7 +5020,7 @@ dependencies = [ "form_urlencoded", "itoa", "ryu", - "serde", + "serde 1.0.210", ] [[package]] @@ -4679,8 +5033,8 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", - "serde", + "indexmap 2.5.0", + "serde 1.0.210", "serde_derive", "serde_json", "serde_with_macros", @@ -4696,7 +5050,20 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.5.0", + "itoa", + "ryu", + "serde 1.0.210", + "unsafe-libyaml", ] [[package]] @@ -4727,6 +5094,19 @@ dependencies = [ "digest", ] +[[package]] +name = "sha256" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18278f6a914fa3070aa316493f7d2ddfb9ac86ebc06fa3b83bffda487e9065b0" +dependencies = [ + "async-trait", + "bytes", + "hex", + "sha2", + "tokio", +] + [[package]] name = "sha3" version = "0.10.8" @@ -4743,7 +5123,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "lazy_static", + "lazy_static 1.5.0", ] [[package]] @@ -4758,6 +5138,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -4804,6 +5190,16 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + [[package]] name = "slab" version = "0.4.9" @@ -4940,7 +5336,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -4951,9 +5347,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "supports-color" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" dependencies = [ "is_ci", ] @@ -4983,9 +5379,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -4994,9 +5390,12 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "syntect" @@ -5011,7 +5410,7 @@ dependencies = [ "once_cell", "onig", "regex-syntax 0.8.4", - "serde", + "serde 1.0.210", "serde_derive", "serde_json", "thiserror", @@ -5021,20 +5420,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -5047,8 +5446,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", + "fastrand 2.1.1", + "rustix 0.38.37", "windows-sys 0.52.0", ] @@ -5088,7 +5487,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.37", "windows-sys 0.48.0", ] @@ -5126,7 +5525,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5149,7 +5548,7 @@ dependencies = [ "itoa", "num-conv", "powerfmt", - "serde", + "serde 1.0.210", "time-core", "time-macros", ] @@ -5170,6 +5569,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tint" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7af24570664a3074673dbbf69a65bdae0ae0b72f2949b1adfbacb736ee4d6896" +dependencies = [ + "lazy_static 0.2.11", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -5196,9 +5604,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5220,24 +5628,37 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" dependencies = [ - "native-tls", + "either", + "futures-util", + "thiserror", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5248,15 +5669,24 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.17" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde 1.0.210", +] + +[[package]] +name = "toml" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a44eede9b727419af8095cb2d72fab15487a541f54647ad4414b34096ee4631" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ - "indexmap 2.2.6", - "serde", + "indexmap 2.5.0", + "serde 1.0.210", "serde_spanned", "toml_datetime", - "toml_edit 0.22.18", + "toml_edit 0.22.20", ] [[package]] @@ -5265,7 +5695,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ - "serde", + "serde 1.0.210", ] [[package]] @@ -5274,42 +5704,50 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", - "serde", + "indexmap 2.5.0", + "serde 1.0.210", "serde_spanned", "toml_datetime", - "winnow 0.5.40", + "winnow 0.6.18", ] [[package]] -name = "toml_edit" -version = "0.22.18" +name = "tower" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1490595c74d930da779e944f5ba2ecdf538af67df1a9848cbd156af43c1b7cf0" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.16", + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", ] +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -5317,6 +5755,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -5330,7 +5769,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -5380,24 +5819,24 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55265878356bdd85c9baa15859c87de93b2bf1f33acf752040a561e4a228f62" +checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" dependencies = [ "dissimilar", "glob", - "serde", + "serde 1.0.210", "serde_derive", "serde_json", "termcolor", - "toml", + "toml 0.8.19", ] [[package]] name = "tui-input" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68699e8bb4ca025ab41fcc602d3d53a5714a56b0cf2d6e93c98aaf4231e3d937" +checksum = "bd137780d743c103a391e06fe952487f914b299a4fe2c3626677f6a6339a7c6b" dependencies = [ "ratatui", "unicode-width", @@ -5448,6 +5887,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -5462,9 +5910,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-linebreak" @@ -5506,9 +5954,21 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -5519,7 +5979,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", - "serde", + "serde 1.0.210", ] [[package]] @@ -5611,12 +6071,13 @@ dependencies = [ [[package]] name = "warg-api" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6155f45f54e013e7e4016ed728d132e5b5e4da6a9ab688edfa0a19a3d6fe87f6" +checksum = "a44b422328c3a86be288f569694aa97df958ade0cd9514ed00bc562952c6778e" dependencies = [ - "itertools 0.11.0", - "serde", + "indexmap 2.5.0", + "itertools 0.12.1", + "serde 1.0.210", "serde_with", "thiserror", "warg-crypto", @@ -5625,24 +6086,32 @@ dependencies = [ [[package]] name = "warg-client" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807a117360b22b04a5e89adf980d48f0076fc28c6d971bf3a868cce29b76a29a" +checksum = "dd1af3c0a73c56613c152fb99048af889a57063756299460c8fc26fea52ddccc" dependencies = [ "anyhow", + "async-recursion", "async-trait", "bytes", "clap", + "dialoguer", "dirs", "futures-util", - "itertools 0.11.0", + "indexmap 2.5.0", + "itertools 0.12.1", + "keyring", "libc", "normpath", "once_cell", "pathdiff", + "ptree", "reqwest", - "serde", + "secrecy", + "semver 1.0.23", + "serde 1.0.210", "serde_json", + "sha256", "tempfile", "thiserror", "tokio", @@ -5654,14 +6123,18 @@ dependencies = [ "warg-crypto", "warg-protocol", "warg-transparency", - "windows-sys 0.48.0", + "wasm-compose", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wasmprinter", + "windows-sys 0.52.0", ] [[package]] name = "warg-crypto" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3421fa178ce468087d2c51b53ae4ab6d435e4e41bb6fee2c2b25bd555df9f6c3" +checksum = "52fb6f3a64e3fef5425a0ab2b4354f1e49a699b76d58dd91d632483634f10474" dependencies = [ "anyhow", "base64 0.21.7", @@ -5672,7 +6145,7 @@ dependencies = [ "p256", "rand_core", "secrecy", - "serde", + "serde 1.0.210", "sha2", "signature", "thiserror", @@ -5680,9 +6153,9 @@ dependencies = [ [[package]] name = "warg-protobuf" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a6adafed625d8d254d34ee0c9836c2f9e6bd5a799b489ffc31c2c572554234" +checksum = "9bbb2d353497af3f6334bce11bfe69d638eedbb6d5059992acb2a05dd0beef5b" dependencies = [ "anyhow", "pbjson", @@ -5693,40 +6166,41 @@ dependencies = [ "prost-types", "protox", "regex", - "serde", + "serde 1.0.210", "warg-crypto", ] [[package]] name = "warg-protocol" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e47b7e7a8a9f9895268b68e7cf29ca1d3129faa9f9bcbc973ff5e92884a014" +checksum = "e3a710c66d8b5f2a7b046ecd2d45121530f561fd5c699b9c85ee49d332cfe773" dependencies = [ "anyhow", "base64 0.21.7", "hex", - "indexmap 2.2.6", + "indexmap 2.5.0", "pbjson-types", "prost", "prost-types", "semver 1.0.23", - "serde", + "serde 1.0.210", "serde_with", "thiserror", "warg-crypto", "warg-protobuf", "warg-transparency", - "wasmparser 0.108.0", + "wasmparser 0.121.2", ] [[package]] name = "warg-transparency" -version = "0.2.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cd84da2c4f298556706e75a8f19df3e2c844be2ce9e959b07904fb66c333cc" +checksum = "5b950a71a544b7ac8f5a5e95f43886ac97c3fe5c7080b955b1b534037596d7be" dependencies = [ "anyhow", + "indexmap 2.5.0", "prost", "thiserror", "warg-crypto", @@ -5739,36 +6213,43 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi-preview1-component-adapter-provider" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36e6cadfa74538edd5409b6f8c79628436529138e9618b7373bec7aae7805835" + [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -5778,9 +6259,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5788,73 +6269,168 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" + +[[package]] +name = "wasm-compose" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "fd324927af875ebedb1b820c00e3c585992d33c2c787c5021fe6d8982527359b" +dependencies = [ + "anyhow", + "heck 0.4.1", + "im-rc", + "indexmap 2.5.0", + "log", + "petgraph", + "serde 1.0.210", + "serde_derive", + "serde_yaml", + "smallvec", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wat", +] [[package]] name = "wasm-encoder" -version = "0.38.1" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" +checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" dependencies = [ "leb128", + "wasmparser 0.121.2", ] [[package]] name = "wasm-encoder" -version = "0.39.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "111495d6204760238512f57a9af162f45086504da332af210f2f75dd80b34f1d" +checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" dependencies = [ "leb128", + "wasmparser 0.215.0", ] [[package]] name = "wasm-encoder" -version = "0.41.2" +version = "0.216.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88" dependencies = [ "leb128", + "wasmparser 0.216.0", ] [[package]] name = "wasm-encoder" -version = "0.214.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff694f02a8d7a50b6922b197ae03883fbf18cdb2ae9fbee7b6148456f5f44041" +checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.10.20" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" +checksum = "0c6bb07c5576b608f7a2a9baa2294c1a3584a249965d695a9814a496cb6d232f" dependencies = [ "anyhow", - "indexmap 2.2.6", - "serde", + "indexmap 2.5.0", + "serde 1.0.210", "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.41.2", - "wasmparser 0.121.2", + "wasm-encoder 0.215.0", + "wasmparser 0.215.0", +] + +[[package]] +name = "wasm-metadata" +version = "0.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c8154d703a6b0e45acf6bd172fa002fc3c7058a9f7615e517220aeca27c638" +dependencies = [ + "anyhow", + "indexmap 2.5.0", + "serde 1.0.210", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.216.0", + "wasmparser 0.216.0", +] + +[[package]] +name = "wasm-pkg-client" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0904880365efa1b4f81e34948d27fabf762837fea05852bbb0c1674c43a802" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.22.1", + "bytes", + "dirs", + "docker_credential", + "futures-util", + "oci-client", + "oci-wasm", + "secrecy", + "serde 1.0.210", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tokio-util", + "toml 0.8.19", + "tracing", + "tracing-subscriber", + "url", + "warg-client", + "warg-crypto", + "warg-protocol", + "wasm-pkg-common", + "wit-component 0.216.0", +] + +[[package]] +name = "wasm-pkg-common" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0287f3ce5f1e03c4cf88bdd533b01dcd315c321eb09cb3dd35cfdf4031d912f9" +dependencies = [ + "anyhow", + "bytes", + "dirs", + "futures-util", + "http", + "reqwest", + "semver 1.0.23", + "serde 1.0.210", + "serde_json", + "sha2", + "thiserror", + "tokio", + "toml 0.8.19", + "tracing", ] [[package]] @@ -5872,58 +6448,54 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.108.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c956109dcb41436a39391139d9b6e2d0a5e0b158e1293ef352ec977e5e36c5" -dependencies = [ - "indexmap 2.2.6", - "semver 1.0.23", -] - -[[package]] -name = "wasmparser" -version = "0.118.2" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 2.2.6", + "bitflags 2.6.0", + "indexmap 2.5.0", "semver 1.0.23", ] [[package]] name = "wasmparser" -version = "0.119.0" +version = "0.214.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c35daf77afb4f9b14016625144a391085ec2ca99ca9cc53ed291bb53ab5278d" +checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6" dependencies = [ + "ahash", "bitflags 2.6.0", - "indexmap 2.2.6", + "hashbrown 0.14.5", + "indexmap 2.5.0", "semver 1.0.23", + "serde 1.0.210", ] [[package]] name = "wasmparser" -version = "0.121.2" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" +checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" dependencies = [ + "ahash", "bitflags 2.6.0", - "indexmap 2.2.6", + "hashbrown 0.14.5", + "indexmap 2.5.0", "semver 1.0.23", + "serde 1.0.210", ] [[package]] name = "wasmparser" -version = "0.214.0" +version = "0.216.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6" +checksum = "bcdee6bea3619d311fb4b299721e89a986c3470f804b6d534340e412589028e3" dependencies = [ "ahash", "bitflags 2.6.0", "hashbrown 0.14.5", - "indexmap 2.2.6", + "indexmap 2.5.0", "semver 1.0.23", - "serde", ] [[package]] @@ -5938,59 +6510,55 @@ dependencies = [ [[package]] name = "wast" -version = "214.0.0" +version = "217.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694bcdb24c49c8709bd8713768b71301a11e823923eee355d530f1d8d0a7f8e9" +checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.214.0", + "wasm-encoder 0.217.0", ] [[package]] name = "wat" -version = "1.214.0" +version = "1.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "347249eb56773fa728df2656cfe3a8c19437ded61a922a0b5e0839d9790e278e" +checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "which" -version = "4.4.2" +name = "webpki-roots" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.34", + "rustls-pki-types", ] [[package]] name = "which" -version = "5.0.0" +version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "once_cell", - "rustix 0.38.34", - "windows-sys 0.48.0", + "rustix 0.38.37", + "winsafe", ] [[package]] @@ -6011,11 +6579,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6064,7 +6632,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6075,7 +6643,18 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", ] [[package]] @@ -6115,6 +6694,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -6247,22 +6835,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.16" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] [[package]] -name = "winreg" -version = "0.50.0" +name = "winsafe" +version = "0.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] name = "winter-air" @@ -6317,7 +6901,7 @@ checksum = "7ce0f4161cdde50de809b3869c1cb083a09e92e949428ea28f04c0d64045875c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6337,97 +6921,119 @@ dependencies = [ [[package]] name = "winter-utils" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0568612a95bcae3c94fb14da2686f8279ca77723dbdf1e97cf3673798faf6485" +checksum = "c3d71ec2c97685c7e7460a30e27f955d26b8426e7c2db0ddb55a6e0537141f53" [[package]] name = "wit-bindgen-core" -version = "0.16.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75d55e1a488af2981fb0edac80d8d20a51ac36897a1bdef4abde33c29c1b6d0d" +checksum = "bb7e3df01cd43cfa1cb52602e4fc05cb2b62217655f6705639b6953eb0a3fed2" dependencies = [ "anyhow", - "wit-component 0.18.2", - "wit-parser", + "heck 0.5.0", + "wit-parser 0.215.0", ] [[package]] name = "wit-bindgen-rust" -version = "0.16.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01ff9cae7bf5736750d94d91eb8a49f5e3a04aff1d1a3218287d9b2964510f8" +checksum = "61a767d1a8eb4e908bfc53febc48b87ada545703b16fe0148ee7736a29a01417" dependencies = [ "anyhow", - "heck 0.4.1", - "wasm-metadata", + "heck 0.5.0", + "indexmap 2.5.0", + "prettyplease", + "syn 2.0.77", + "wasm-metadata 0.215.0", "wit-bindgen-core", - "wit-component 0.18.2", + "wit-component 0.215.0", ] [[package]] name = "wit-component" -version = "0.18.2" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" +checksum = "f725e3885fc5890648be5c5cbc1353b755dc932aa5f1aa7de968b912a3280743" dependencies = [ "anyhow", "bitflags 2.6.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "log", - "serde", + "serde 1.0.210", "serde_derive", "serde_json", - "wasm-encoder 0.38.1", - "wasm-metadata", - "wasmparser 0.118.2", - "wit-parser", + "wasm-encoder 0.215.0", + "wasm-metadata 0.215.0", + "wasmparser 0.215.0", + "wit-parser 0.215.0", ] [[package]] name = "wit-component" -version = "0.19.1" +version = "0.216.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "429e3c06fba3a7566aab724ae3ffff3152ede5399d44789e7dd11f5421292859" +checksum = "7e2ca3ece38ea2447a9069b43074ba73d96dde1944cba276c54e41371745f9dc" dependencies = [ "anyhow", "bitflags 2.6.0", - "indexmap 2.2.6", + "indexmap 2.5.0", "log", - "serde", + "serde 1.0.210", "serde_derive", "serde_json", - "wasm-encoder 0.39.0", - "wasm-metadata", - "wasmparser 0.119.0", - "wit-parser", + "wasm-encoder 0.216.0", + "wasm-metadata 0.216.0", + "wasmparser 0.216.0", + "wit-parser 0.216.0", ] [[package]] name = "wit-parser" -version = "0.13.2" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" +checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" dependencies = [ "anyhow", "id-arena", - "indexmap 2.2.6", + "indexmap 2.5.0", "log", "semver 1.0.23", - "serde", + "serde 1.0.210", "serde_derive", "serde_json", "unicode-xid", + "wasmparser 0.215.0", +] + +[[package]] +name = "wit-parser" +version = "0.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4d108165c1167a4ccc8a803dcf5c28e0a51d6739fd228cc7adce768632c764c" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.5.0", + "log", + "semver 1.0.23", + "serde 1.0.210", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.216.0", ] [[package]] name = "xdg-home" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6473,7 +7079,7 @@ dependencies = [ "once_cell", "ordered-stream", "rand", - "serde", + "serde 1.0.210", "serde_repr", "sha1", "static_assertions", @@ -6506,7 +7112,7 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" dependencies = [ - "serde", + "serde 1.0.210", "static_assertions", "zvariant", ] @@ -6529,7 +7135,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.77", ] [[package]] @@ -6547,7 +7153,7 @@ dependencies = [ "byteorder", "enumflags2", "libc", - "serde", + "serde 1.0.210", "static_assertions", "zvariant_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 8a061f91b..26bfea1f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,8 +26,8 @@ exclude = [ ] [workspace.package] -version = "0.0.5" -rust-version = "1.78" +version = "0.0.7" +rust-version = "1.80" authors = ["Miden contributors"] description = "An intermediate representation and compiler for Miden Assembly" repository = "https://github.com/0xPolygonMiden/compiler" @@ -92,18 +92,19 @@ miden-stdlib = { version = "0.10.3", features = ["with-debug-info"] } #miden-core = { git = "https://github.com/0xPolygonMiden/miden-vm", rev = "828557c28ca1d159bfe42195e7ea73256ce4aa06" } #miden-processor = { git = "https://github.com/0xPolygonMiden/miden-vm", rev = "828557c28ca1d159bfe42195e7ea73256ce4aa06" } #miden-stdlib = { git = "https://github.com/0xPolygonMiden/miden-vm", rev = "828557c28ca1d159bfe42195e7ea73256ce4aa06" } -midenc-codegen-masm = { version = "0.0.5", path = "codegen/masm" } -midenc-hir = { version = "0.0.5", path = "hir" } -midenc-hir-analysis = { version = "0.0.5", path = "hir-analysis" } -midenc-hir-macros = { version = "0.0.5", path = "hir-macros" } -midenc-hir-symbol = { version = "0.0.5", path = "hir-symbol" } -midenc-hir-transform = { version = "0.0.5", path = "hir-transform" } -midenc-hir-type = { version = "0.0.5", path = "hir-type" } -midenc-frontend-wasm = { version = "0.0.5", path = "frontend-wasm" } -midenc-compile = { version = "0.0.5", path = "midenc-compile" } -midenc-driver = { version = "0.0.5", path = "midenc-driver" } -midenc-debug = { version = "0.0.5", path = "midenc-debug" } -midenc-session = { version = "0.0.5", path = "midenc-session" } +midenc-codegen-masm = { version = "0.0.7", path = "codegen/masm" } +midenc-hir = { version = "0.0.7", path = "hir" } +midenc-hir-analysis = { version = "0.0.7", path = "hir-analysis" } +midenc-hir-macros = { version = "0.0.7", path = "hir-macros" } +midenc-hir-symbol = { version = "0.0.7", path = "hir-symbol" } +midenc-hir-transform = { version = "0.0.7", path = "hir-transform" } +midenc-hir-type = { version = "0.0.7", path = "hir-type" } +midenc-frontend-wasm = { version = "0.0.7", path = "frontend-wasm" } +midenc-compile = { version = "0.0.7", path = "midenc-compile" } +midenc-driver = { version = "0.0.7", path = "midenc-driver" } +midenc-debug = { version = "0.0.7", path = "midenc-debug" } +midenc-session = { version = "0.0.7", path = "midenc-session" } +cargo-miden = { version = "0.0.7", path = "tools/cargo-miden" } miden-integration-tests = { version = "0.0.0", path = "tests/integration" } wat = "1.0.69" blake3 = "1.5" diff --git a/Makefile.toml b/Makefile.toml index dd044c50f..817428243 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -18,8 +18,14 @@ BACKTRACE_DEFAULT = { source = "${CARGO_MAKE_CI}", mapping = { "true" = "1", "fa RUST_BACKTRACE = { value = "${BACKTRACE_DEFAULT}", condition = { env_not_set = [ "RUST_BACKTRACE", ] } } -MIDEN_BIN_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/bin" -MIDEN_INSTALL_DIR = "${MIDEN_BIN_DIR}/${CARGO_MAKE_RUST_TARGET_TRIPLE}" +MIDENC_BIN_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/bin" +MIDENC_INSTALL_DIR = "${MIDENC_BIN_DIR}/${CARGO_MAKE_RUST_TARGET_TRIPLE}" + +[env.development] +MIDENC_BUILD_PROFILE = "debug" + +[env.production] +MIDENC_BUILD_PROFILE = "release" [tasks.init] run_task = "print-env" @@ -52,8 +58,8 @@ echo " Command: ${CARGO_MAKE_COMMAND}" echo " Working Directory: ${CARGO_MAKE_WORKING_DIRECTORY}" echo " Target Directory: ${CARGO_TARGET_DIR}" echo " Profile: ${CARGO_MAKE_PROFILE}" -echo " Bin Directory: ${MIDEN_BIN_DIR}" -echo " Install Directory: ${MIDEN_INSTALL_DIR}" +echo " Bin Directory: ${MIDENC_BIN_DIR}" +echo " Install Directory: ${MIDENC_INSTALL_DIR}" echo " Target Triple: ${CARGO_MAKE_RUST_TARGET_TRIPLE}" echo " RUST_BACKTRACE: ${RUST_BACKTRACE}" echo "*************************************" @@ -78,10 +84,22 @@ category = "Tools" condition = { env_set = ["CARGO_MAKE_RUST_CHANNEL"] } script = [''' #!@duckscript +output = exec --fail-on-error rustc "--version" +assert_eq ${output.code} 0 +rustc_version_parts = split ${output.stdout} " " +hash_raw = array_get ${rustc_version_parts} 2 +hash = replace ${hash_raw} "(" "" +date_raw = array_get ${rustc_version_parts} 3 +date = replace ${date_raw} ")\n" "" +release ${rustc_version_parts} + + echo "*************************************" echo "Rust:" echo " Version: ${CARGO_MAKE_RUST_VERSION}" echo " Channel: ${CARGO_MAKE_RUST_CHANNEL}" +echo " Build Hash: ${hash}" +echo " Build Date: ${date}" echo " Target Arch: ${CARGO_MAKE_RUST_TARGET_ARCH}" echo " Target Env: ${CARGO_MAKE_RUST_TARGET_ENV}" echo " Target OS: ${CARGO_MAKE_RUST_TARGET_OS}" @@ -148,7 +166,7 @@ args = [ "-p", "midenc", "--out-dir", - "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/bin", + "${MIDENC_BIN_DIR}", ] [tasks.build] @@ -158,7 +176,7 @@ run_task = [{ name = ["midenc"] }] [tasks.install] category = "Install" -description = "Installs the compiler suite via cargo" +description = "Installs the compiler via cargo" run_task = [{ name = ["install-midenc"] }] [tasks.check] @@ -186,37 +204,17 @@ args = [ "install", "--path", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/midenc", - "--debug", + "--${MIDENC_BUILD_PROFILE}", "--force", "--bin", "midenc", ] -[tasks.install-wasm-target] -category = "Test" -description = "Install wasm32-unknown-unknown target" -command = "rustup" -args = ["target", "add", "wasm32-unknown-unknown"] - -[tasks.install-wasm-wasi-target] -category = "Test" -description = "Install wasm32-wasi target" -command = "rustup" -# `wasm32-wasi` target is renamed to `wasm32-wasip1` -# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html -args = ["target", "add", "wasm32-wasip1"] - -[tasks.install-rust-src] -category = "Test" -description = "Install rust-src component" -command = "rustup" -args = ["component", "add", "rust-src"] - [tasks.install-cargo-component] category = "Test" description = "Install cargo-component extension" command = "cargo" -args = ["install", "cargo-component@0.14.0"] +args = ["install", "cargo-component@0.16.0"] [tasks.test-rust] category = "Test" @@ -229,12 +227,7 @@ args = [ "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", "${@}", ] -dependencies = [ - "install-wasm-target", - "install-wasm-wasi-target", - "install-rust-src", - "install-cargo-component", -] +dependencies = ["install-cargo-component"] [tasks.test-lit] category = "Test" @@ -256,13 +249,13 @@ category = "Test" description = "Set up the litcheck utility" install_crate = { crate_name = "litcheck", test_arg = "--help" } -[tasks.book] +[tasks.docs] category = "Build" description = "Builds the compiler documentation" command = "docs/mkdocs" args = ["build", "-d", "target/docs/site"] -[tasks.serve-book] +[tasks.serve-docs] category = "Build" description = "Opens the compiler documentation" command = "docs/mkdocs" @@ -288,10 +281,3 @@ args = [ "-D", "warnings", ] -dependencies = ["install-clippy"] - -[tasks.install-clippy] -category = "Development" -description = "Installs cargo clippy plugin." -command = "rustup" -args = ["component", "add", "clippy"] diff --git a/codegen/masm/CHANGELOG.md b/codegen/masm/CHANGELOG.md index a6f1bebbb..b911fa63b 100644 --- a/codegen/masm/CHANGELOG.md +++ b/codegen/masm/CHANGELOG.md @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-codegen-masm-v0.0.6...midenc-codegen-masm-v0.0.7) - 2024-09-17 + +### Other +- fix up new clippy warnings +- update rust toolchain + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-codegen-masm-v0.0.5...midenc-codegen-masm-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.3](https://github.com/0xPolygonMiden/compiler/compare/midenc-codegen-masm-v0.0.2...midenc-codegen-masm-v0.0.3) - 2024-08-30 ### Fixed diff --git a/codegen/masm/src/codegen/emit/int64.rs b/codegen/masm/src/codegen/emit/int64.rs index 7bde1cc44..21f78402c 100644 --- a/codegen/masm/src/codegen/emit/int64.rs +++ b/codegen/masm/src/codegen/emit/int64.rs @@ -384,11 +384,10 @@ impl<'a> OpEmitter<'a> { /// The semantics of this operation depend on the `overflow` setting: /// /// * There is no unchecked variant for u64, so wrapping is used instead - /// * When checked, both the operands and the result are validated to ensure - /// they are valid u64 values. - /// * Overflowing and wrapping variants follow the usual semantics, with the - /// exception that neither type validates the operands, it is assumed that - /// the caller has already done this. + /// * When checked, both the operands and the result are validated to ensure they are valid u64 + /// values. + /// * Overflowing and wrapping variants follow the usual semantics, with the exception that + /// neither type validates the operands, it is assumed that the caller has already done this. /// /// The caller is assumed to know that different `overflow` settings can /// produce different results, and that those differences are handled. @@ -456,11 +455,10 @@ impl<'a> OpEmitter<'a> { /// The semantics of this operation depend on the `overflow` setting: /// /// * There is no unchecked variant for u64, so wrapping is used instead - /// * When checked, both the operands and the result are validated to ensure - /// they are valid u64 values. - /// * Overflowing and wrapping variants follow the usual semantics, with the - /// exception that neither type validates the operands, it is assumed that - /// the caller has already done this. + /// * When checked, both the operands and the result are validated to ensure they are valid u64 + /// values. + /// * Overflowing and wrapping variants follow the usual semantics, with the exception that + /// neither type validates the operands, it is assumed that the caller has already done this. /// /// The caller is assumed to know that different `overflow` settings can /// produce different results, and that those differences are handled. @@ -524,11 +522,10 @@ impl<'a> OpEmitter<'a> { /// The semantics of this operation depend on the `overflow` setting: /// /// * There is no unchecked variant for u64, so wrapping is used instead - /// * When checked, both the operands and the result are validated to ensure - /// they are valid u64 values. - /// * Overflowing and wrapping variants follow the usual semantics, with the - /// exception that neither type validates the operands, it is assumed that - /// the caller has already done this. + /// * When checked, both the operands and the result are validated to ensure they are valid u64 + /// values. + /// * Overflowing and wrapping variants follow the usual semantics, with the exception that + /// neither type validates the operands, it is assumed that the caller has already done this. /// /// The caller is assumed to know that different `overflow` settings can /// produce different results, and that those differences are handled. diff --git a/codegen/masm/src/codegen/emit/mem.rs b/codegen/masm/src/codegen/emit/mem.rs index 320fbe156..9a26b945b 100644 --- a/codegen/masm/src/codegen/emit/mem.rs +++ b/codegen/masm/src/codegen/emit/mem.rs @@ -746,9 +746,8 @@ impl<'a> OpEmitter<'a> { /// * A machine word is a 32-bit chunk stored in a single field element /// * A double word is a pair of 32-bit chunks /// * A quad word is a quartet of 32-bit chunks (i.e. a Miden "word") - /// * An unaligned double-word requires three 32-bit chunks to represent, - /// since the first chunk does not contain a full 32-bits, so an extra is - /// needed to hold those bits. + /// * An unaligned double-word requires three 32-bit chunks to represent, since the first chunk + /// does not contain a full 32-bits, so an extra is needed to hold those bits. /// /// As an example, assume the pointer we are dereferencing is a u64 value, /// which has 8-byte alignment, and the value is stored 40 bytes from the @@ -789,9 +788,8 @@ impl<'a> OpEmitter<'a> { /// * A machine word is a 32-bit chunk stored in a single field element /// * A double word is a pair of 32-bit chunks /// * A quad word is a quartet of 32-bit chunks (i.e. a Miden "word") - /// * An unaligned quad-word requires five 32-bit chunks to represent, - /// since the first chunk does not contain a full 32-bits, so an extra is - /// needed to hold those bits. + /// * An unaligned quad-word requires five 32-bit chunks to represent, since the first chunk + /// does not contain a full 32-bits, so an extra is needed to hold those bits. /// /// See the example in [OpEmitter::realign_quad_word] for more details on how bits are /// laid out in each word, and what is required to realign unaligned words. diff --git a/codegen/masm/src/codegen/emit/unary.rs b/codegen/masm/src/codegen/emit/unary.rs index 89d709cef..6387c567a 100644 --- a/codegen/masm/src/codegen/emit/unary.rs +++ b/codegen/masm/src/codegen/emit/unary.rs @@ -201,10 +201,10 @@ impl<'a> OpEmitter<'a> { /// but the general rules are as follows: /// /// * Any integer-to-integer cast is allowed - /// * Casting a signed integer to an unsigned integer will assert that the - /// input value is unsigned - /// * Casting a type with a larger range to a type with a smaller one will - /// assert that the input value fits within that range, e.g. u8 to i8, i16 to i8, etc. + /// * Casting a signed integer to an unsigned integer will assert that the input value is + /// unsigned + /// * Casting a type with a larger range to a type with a smaller one will assert that the input + /// value fits within that range, e.g. u8 to i8, i16 to i8, etc. /// * Casting to a larger unsigned type will use zero-extension /// * Casting a signed type to a larger signed type will use sign-extension /// * Casting an unsigned type to a larger signed type will use zero-extension diff --git a/codegen/masm/src/codegen/emitter.rs b/codegen/masm/src/codegen/emitter.rs index 4f4262277..13773f604 100644 --- a/codegen/masm/src/codegen/emitter.rs +++ b/codegen/masm/src/codegen/emitter.rs @@ -298,14 +298,14 @@ impl<'b, 'f: 'b> BlockEmitter<'b, 'f> { /// whether we have visited the successor block previously, nor not. /// /// * If this is the first visit to the successor, then due to the transformation passes - /// we expect to have been run on the input IR (namely treeification and block inlining), - /// it should be the case that these unconditional branches only exist in the IR when the - /// current block is a loop header, or the successor is a loop header. + /// we expect to have been run on the input IR (namely treeification and block inlining), + /// it should be the case that these unconditional branches only exist in the IR when the + /// current block is a loop header, or the successor is a loop header. /// /// * If we have visited the successor previously, then we are emitting code for a loopback - /// edge, and the successor must be a loop header. We must emit the loop header inline in the - /// current block, up to the terminator, and then emit instructions to either continue the - /// loop, or exit the current loop to the target loop. + /// edge, and the successor must be a loop header. We must emit the loop header inline in the + /// current block, up to the terminator, and then emit instructions to either continue the + /// loop, or exit the current loop to the target loop. fn emit_br(&mut self, inst_info: &InstInfo, op: &hir::Br, tasks: &mut Tasks) { let destination = op.successor.destination; diff --git a/codegen/masm/src/codegen/opt/operands/tactics/move_down_and_swap.rs b/codegen/masm/src/codegen/opt/operands/tactics/move_down_and_swap.rs index fc3ac31f2..10c261b9e 100644 --- a/codegen/masm/src/codegen/opt/operands/tactics/move_down_and_swap.rs +++ b/codegen/masm/src/codegen/opt/operands/tactics/move_down_and_swap.rs @@ -7,16 +7,12 @@ use super::*; /// The criteria for this succeeding is: /// /// 0. There must be no copies required, and at least two operands expected -/// 1. The value on top of the stack should either be -/// evicted, or should be moved to its expected -/// position, and if applicable, past any remaining -/// operands which belong before it in the final -/// ordering -/// 2. After moving the value on top, one of the following -/// is true: +/// 1. The value on top of the stack should either be evicted, or should be moved to its expected +/// position, and if applicable, past any remaining operands which belong before it in the final +/// ordering +/// 2. After moving the value on top, one of the following is true: /// * The stack is now ordered, and we're done -/// * The operand on top of the stack is out of place, -/// and the operand in its place is either: +/// * The operand on top of the stack is out of place, and the operand in its place is either: /// 1. Expected to be on top of the stack, so we can swap /// 2. Will be moved into place if we move the top of the stack immediately past it, so we can /// move diff --git a/codegen/masm/src/codegen/scheduler.rs b/codegen/masm/src/codegen/scheduler.rs index 6a658d8c8..85c309623 100644 --- a/codegen/masm/src/codegen/scheduler.rs +++ b/codegen/masm/src/codegen/scheduler.rs @@ -1126,15 +1126,16 @@ fn build_dependency_graph( /// This function performs two primary tasks: /// /// 1. Ensure that there are edges in the graph between instructions that must not be reordered -/// past each other during scheduling. An obvious example is loads and stores: you might have two -/// independent expression trees that read and write to the same memory location - but if the order -/// in which the corresponding loads and stores are scheduled changes, it can change the behavior -/// of the program. Other examples include function calls with side effects and inline assembly. +/// past each other during scheduling. An obvious example is loads and stores: you might have two +/// independent expression trees that read and write to the same memory location - but if the +/// order in which the corresponding loads and stores are scheduled changes, it can change the +/// behavior of the program. Other examples include function calls with side effects and inline +/// assembly. /// /// 2. Ensure that even if an instruction has no predecessors, it still gets scheduled if it has -/// side effects. This can happen if there are no other effectful instructions in the same block. -/// We add an edge from the block terminator to these instructions, which will guarantee that -/// they are executed before leaving the block. +/// side effects. This can happen if there are no other effectful instructions in the same block. +/// We add an edge from the block terminator to these instructions, which will guarantee that +/// they are executed before leaving the block. /// /// We call these instruction->instruction dependencies "control dependencies", since control flow /// in the block depends on them being executed first. If such instructions have no predecessors diff --git a/codegen/masm/src/emulator/mod.rs b/codegen/masm/src/emulator/mod.rs index 701c18c73..526ccb7a1 100644 --- a/codegen/masm/src/emulator/mod.rs +++ b/codegen/masm/src/emulator/mod.rs @@ -112,8 +112,8 @@ enum Status { /// * It only handles instructions which are defined in the [Op] enum /// * Anything related to proving, calling contracts, etc. is not supported /// * The default environment is empty, i.e. there are no Miden VM standard -/// library functions available. Users must emit Miden IR for all functions -/// they wish to call, or alternatively, provide native stubs. +/// library functions available. Users must emit Miden IR for all functions +/// they wish to call, or alternatively, provide native stubs. pub struct Emulator { status: Status, functions: FxHashMap, diff --git a/codegen/masm/src/lib.rs b/codegen/masm/src/lib.rs index 8a7e38024..6257cddc7 100644 --- a/codegen/masm/src/lib.rs +++ b/codegen/masm/src/lib.rs @@ -1,6 +1,5 @@ #![feature(array_windows)] #![feature(iter_array_chunks)] -#![feature(is_sorted)] #![feature(debug_closure_helpers)] extern crate alloc; diff --git a/docs/README.txt b/docs/README.txt index 4c0224546..f01fe0afd 100644 --- a/docs/README.txt +++ b/docs/README.txt @@ -4,6 +4,35 @@ This directory contains the sources for the [Miden Compiler Documentation](https All doc files are written in Markdown, and are converted into an online book using [mkdocs](https://squidfunk.github.io/mkdocs-material/). -# License +## Building the docs + +You can build and view the documentation using two different methods, depending on whether or not +you have `cargo` installed. + +**NOTE:** Both methods described below are expected to be run from the root of the compiler project. + +### Using `cargo` + +To build the docs, use `cargo make docs`. This will place the build output in the `target/docs/site` +directory. + +If you wish to build the docs _and_ run a server to view them, which will reload when changes are +made, use `cargo make serve-docs`. The hostname and port will be displayed in the terminal, but by +default the docs should be available at `http://127.0.0.1:8000`. + +### Using `mkdocs` script + +If you don't have `cargo` installed, you can use this method instead. Again, the commands below are +written with the current working directory being the root of the compiler project, _not_ this +directory. + +To build the docs, use `docs/mkdocs build -d target/docs/site`. This matches the behavior of the +`cargo make docs` command. + +To view the docs in your browser, with reload on change enabled, use `docs/mkdocs serve`. The +hostname and port where the docs can be viewed will be printed to the terminal, but by default this +is `http://127.0.0.1:8000`. + +## License MIT diff --git a/docs/appendix/calling_conventions.md b/docs/appendix/calling-conventions.md similarity index 99% rename from docs/appendix/calling_conventions.md rename to docs/appendix/calling-conventions.md index 6acc64806..04baaa175 100644 --- a/docs/appendix/calling_conventions.md +++ b/docs/appendix/calling-conventions.md @@ -1,4 +1,4 @@ -# Calling Conventions +# Calling conventions This document describes the various calling conventions recognized/handled by the compiler, including a specification for the interaction with the IR type system. @@ -25,17 +25,16 @@ There are four calling conventions represented in the compiler: convention is allowed to have types in its signature that are/contain pointers, with certain caveats around those pointers. - All four conventions above are based on the System V C ABI, tailored to the Miden VM. The only exception is `Fast`, which may modify the ABI arbitrarily as it sees fit, and makes no guarantees about what modifications, if any, it will make. -# Data Representation +## Data representation The following is a description of how the IR type system is represented in the `C` calling convention. Later, a description of how the other conventions extend/restrict/modify this representation will be provided. -## Scalars +### Scalars General type | C Type | IR Type | `sizeof` | Alignment (bytes) | Miden Type -|-|-|-|-|- @@ -101,14 +100,14 @@ two's complement rules. The Miden VM only has native support for field elements, words, and `u32`; all other types are implemented in software using intrinsics. -## Aggregates and Unions +### Aggregates and unions Structures and unions assume the alignment of their most strictly aligned component. Each member is assigned to the lowest available offset with the appropriate alignment. The size of any object is always a multiple of the object's alignment. An array uses the same alignment as its elements. Structure and union objects can require padding to meet size and alignment constraints. The contents of any padding is undefined. -## Memory Model +### Memory model Interacting with memory in Miden is quite similar to WebAssembly in some ways: @@ -176,12 +175,12 @@ word-aligned or element-aligned, so an unaligned load or store would require eit bytes starting at some arbitrary address. In practice, most loads/stores are likely to be element-aligned, so most overhead from emulation will come from values which cross an element or word boundary. -# Function Calls +## Function calls This section describes the conventions followed when executing a function call via `exec`, including how arguments are passed on the operand stack, stack frames, etc. Later, we'll cover the differences when executing calls via `call` or `syscall`. -## Locals and the stack frame +### Locals and the stack frame Miden does not have registers in the style of hardware architectures. Instead it has an operand stack, on which an arbitrary number of operands may be stored, and local variables. In both cases - an operand on the operand stack, or a single local variable - the value @@ -201,7 +200,7 @@ Because there are no registers, the notion of callee-saved or caller-saved regis in its place, a somewhat equivalent set of rules defines the contract between caller and callee in terms of the state of the operand stack, those are described below in the section covering the operand stack. -### The shadow stack +#### The shadow stack Miden is a [Harvard](https://en.wikipedia.org/wiki/Harvard_architecture) architecture; as such, code and data are not in the same memory space. More precisely, in Miden, code is only addressable via the hash of the MAST root of that code, which must correspond to code that @@ -222,7 +221,7 @@ constraints of the callee's calling convention). Languages with more elaborate requirements with regard to the stack will need to implement their own shadow stack, and emit code in function prologues/epilogues to manage it. -### The operand stack +#### The operand stack The Miden virtual machine is a stack machine, not a register machine. Rather than having a fixed set of registers that are used to store and manipulate scalar values, the Miden VM has the operand stack, which can hold an arbitrary number of operands (where each @@ -246,7 +245,7 @@ then one of the following must happen: which refers to the remaining arguments on the advice provider stack. The callee must arrange to fetch the spilled arguments from the advice provider using that hash. -### Function signatures +#### Function signatures Miden Abstract Syntax Trees (MASTs) do not have any notion of functions, and as such are not aware of parameters, return values, etc. For this document, that's not a useful level of abstraction to examine. Even a step higher, Miden Assembly (MASM) has functions (procedures diff --git a/docs/appendix/canonabi-adhocabi-mismatch.md b/docs/appendix/canonabi-adhocabi-mismatch.md index efd207e9f..17413987a 100644 --- a/docs/appendix/canonabi-adhocabi-mismatch.md +++ b/docs/appendix/canonabi-adhocabi-mismatch.md @@ -1,4 +1,4 @@ -# Canonical ABI vs Miden ABI Incompatibility +# Canonical ABI vs Miden ABI incompatibility This document describes an issue that arises when trying to map the ad-hoc calling convention/ABI used by various Miden Assembly procedures, such as those comprising the transaction kernel, and @@ -140,7 +140,7 @@ library is a part of the Miden compiler. It is not anticipated that we will have these; however in the near term we are going to manually map procedures to their adapter strategies, as we have not yet automated the pattern recognition step. -### Return-via-pointer Adapter +### Return-via-pointer adapter The return value is expected to be returned by storing its flattened representation in a pointer passed as an argument. @@ -174,7 +174,7 @@ func wasm_core_add_asset(v0: f64, v1: f64, v2: f64, v3: f64, ptr: i32) { } ``` -### No-op Adapter +### No-op adapter No adapter is needed. The Wasm core function type is the same as the tx kernel ad-hoc signature. @@ -183,7 +183,7 @@ This Miden ABI pattern is selected if no other Miden ABI pattern is applicable a For example, the `get_id` function falls under this Miden ABI pattern and its calls will be translated to the tx kernel function calls without any modifications. -## Transaction kernel functions that require manual adapter functions: +## Transaction kernel functions that require manual adapter functions ### `get_assets` diff --git a/docs/appendix/known-limitations.md b/docs/appendix/known-limitations.md index a9e18104e..4cd203a45 100644 --- a/docs/appendix/known-limitations.md +++ b/docs/appendix/known-limitations.md @@ -1,4 +1,4 @@ -# Known Limitations +# Known limitations !!! tip @@ -13,9 +13,9 @@ important to be aware of this when using the compiler. The features discussed below are broken up into sections, to make them easier to navigate and reference. -## Rust Language Support +## Rust language support -### Floating Point Types +### Floating point types - Status: **Unsupported** - Tracking Issue: N/A @@ -34,8 +34,7 @@ first place. At this point in time, we have no plans to support floats, but this may change if we are able to find a better/more natural representation for `Felt` in WebAssembly. - -### Function Call Indirection +### Function call indirection - Status: **Unimplemented** - Tracking Issue: [#32](https://github.com/0xPolygonMiden/compiler/issues/32) @@ -55,7 +54,7 @@ will raise an error when it encounters any use of `call_indirect`. the amount of inlining that can occur. Even then, it may not be possible to remove some forms of indirection, in which case you will need to find another workaround. -#### Iterator Lowered to Loop +#### Iterator lowered to loop ```rust pub fn is_zeroed(bytes: &[u8; 32]) -> bool { @@ -64,7 +63,7 @@ pub fn is_zeroed(bytes: &[u8; 32]) -> bool { } ``` -#### Monomorphization + Inlining +#### Monomorphization + inlining ```rust pub fn call(fun: F) -> T @@ -84,7 +83,7 @@ fn main() { } ``` -#### Inlined Trait Impl +#### Inlined trait impl ```rust pub trait Foo { @@ -124,7 +123,7 @@ will be expanding the SDK rapidly over the next few weeks and months, but for th you encounter a missing API that you need, let us know, so we can ensure it is prioritized above APIs which are lesser used. -### Rust/Miden FFI (Foreign Function Interface) and Interop +### Rust/Miden FFI (foreign function interface) and interop - Status: **Internal Use Only** - Tracking Issue: [#304](https://github.com/0xPolygonMiden/compiler/issues/304) @@ -148,9 +147,9 @@ procedures at a minimum, and in some cases we may require details of the calling This metadata does not currently exist, but is on the roadmap for inclusion into Miden Assembly and Miden packaging. Once present, we can open up the FFI for general use. -## Core Miden Functionality +## Core Miden functionality -### Dynamic Procedure Invocation +### Dynamic procedure invocation - Status: **Unimplemented** - Tracking Issue: [#32](https://github.com/0xPolygonMiden/compiler/issues/32) @@ -175,7 +174,7 @@ the body of which drop the callee hash, fix up the operand stack as necessary, a simple `exec` or `call` to invoke the "real" callee. We will emit a single stub for every function which has its "address" taken, and use the hash of the stub in place of the actual callee hash. -### Cross-Context Procedure Invocation +### Cross-context procedure invocation - Status: **Unimplemented** - Tracking Issue: [#303](https://github.com/0xPolygonMiden/compiler/issues/303) @@ -213,7 +212,7 @@ subfeatures being implemented first. ## Packaging -### Package Format +### Package format - Status: **Experimental** - Tracking Issue: [#121](https://github.com/0xPolygonMiden/compiler/issues/121) diff --git a/docs/design/frontends.md b/docs/design/frontends.md index 30d624bbd..e48dfbf47 100644 --- a/docs/design/frontends.md +++ b/docs/design/frontends.md @@ -1,4 +1,4 @@ -# Supported Frontends +# Supported front ends ## WebAssembly (Wasm) diff --git a/docs/design/overview.md b/docs/design/overview.md index 95fb3cbbf..fc09cffc9 100644 --- a/docs/design/overview.md +++ b/docs/design/overview.md @@ -1,4 +1,4 @@ -# Compiler Architecture +# Compiler architecture This is an index of various design documents for the compiler and its components. Some of these are planned topics, and some have documentation that hasn't been polished up yet. We'll slowly diff --git a/docs/guides/develop_miden_in_rust.md b/docs/guides/develop_miden_in_rust.md index 2c2524453..118653a41 100644 --- a/docs/guides/develop_miden_in_rust.md +++ b/docs/guides/develop_miden_in_rust.md @@ -1,10 +1,10 @@ -# Developing Miden Programs In Rust +# Developing Miden programs in Rust This chapter will walk through how to develop Miden programs in Rust using the standard library provided by the `miden-stdlib-sys` crate (see the -[README](https://github.com/0xPolygonMiden/compiler/sdk/stdlib-sys/README.md)). +[README](https://github.com/0xPolygonMiden/compiler/blob/main/sdk/stdlib-sys/README.md). -## Getting Started +## Getting started Import the standard library from the `miden-stdlib-sys` crate: diff --git a/docs/guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md b/docs/guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md index e1326e890..5e2145773 100644 --- a/docs/guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md +++ b/docs/guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md @@ -1,3 +1,3 @@ -# Developing Miden Rollup Accounts And Note Scripts In Rust +# Developing Miden rollup accounts and note scripts in Rust -This chapter will walk through how to develop Miden rollup accounts and note scripts in Rust using the Miden SDK crate. \ No newline at end of file +This chapter walks you through how to develop Miden rollup accounts and note scripts in Rust using the Miden SDK crate. \ No newline at end of file diff --git a/docs/guides/rust_to_wasm.md b/docs/guides/rust_to_wasm.md index bafa054dc..19ce9fdb5 100644 --- a/docs/guides/rust_to_wasm.md +++ b/docs/guides/rust_to_wasm.md @@ -168,7 +168,7 @@ Which dumps the following output (may differ slightly on your machine, depending Success! -## Next Steps +## Next steps In [Compiling WebAssembly to Miden Assembly](wasm_to_masm.md), we walk through how to take the WebAssembly module we just compiled, and lower it to Miden Assembly using `midenc`! diff --git a/docs/guides/wasm_to_masm.md b/docs/guides/wasm_to_masm.md index a7c3e998c..b9c993e57 100644 --- a/docs/guides/wasm_to_masm.md +++ b/docs/guides/wasm_to_masm.md @@ -122,7 +122,7 @@ We can test our compiled program like so: Success! We got the expected result of `55`. -## Next Steps +## Next steps This guide is not comprehensive, as we have not yet examined in detail the differences between compiling libraries vs programs, linking together multiple libraries, packages, or discussed some of diff --git a/docs/index.md b/docs/index.md index 37b52ddce..aa212383a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ -# Getting Started +# Getting started -Welcome to the documentation for the Miden compiler toolchain! +Welcome to the documentation for the Miden compiler toolchain. !!! warning @@ -78,7 +78,7 @@ We do not currently perform any optimizations on the IR, since we are primarily output of compiler backends which have already applied optimizations, at this time. This may change in the future, but for now it is expected that you implement your own optimization passes as needed. -## Known Bugs and Limitations +## Known bugs and limitations For the latest information on known bugs, see the [issue tracker](https://github.com/0xpolygonmiden/compiler/issues). diff --git a/docs/usage/cargo-miden.md b/docs/usage/cargo-miden.md index 18db2361e..8e221e3fd 100644 --- a/docs/usage/cargo-miden.md +++ b/docs/usage/cargo-miden.md @@ -1,4 +1,4 @@ -# Getting Started with Cargo +# Getting started with Cargo As part of the Miden compiler toolchain, we provide a Cargo extension, `cargo-miden`, which provides a template to spin up a new Miden project in Rust, and takes care of orchestrating `rustc` and @@ -58,7 +58,7 @@ Now that you've created your project, compiling it to Miden Assembly is as easy following command from the root of the project directory: ```bash -cargo miden build +cargo miden build --release ``` This will emit the compiled artifacts to `target/miden`. diff --git a/docs/usage/debugger.md b/docs/usage/debugger.md index 14ebf0810..f79c60d93 100644 --- a/docs/usage/debugger.md +++ b/docs/usage/debugger.md @@ -1,4 +1,4 @@ -# Debugging Programs +# Debugging programs A very useful tool in the Miden compiler suite, is its TUI-based interactive debugger, accessible via the `midenc debug` command. @@ -8,7 +8,7 @@ via the `midenc debug` command. The debugger is still quite new, and while very useful already, still has a fair number of UX annoyances. Please report any bugs you encounter, and we'll try to get them patched ASAP! -## Getting Started +## Getting started The debugger is launched by executing `midenc debug`, and giving it a path to a program compiled by `midenc compile`. See [Program Inputs](#program-inputs) for information on how to provide inputs @@ -26,7 +26,7 @@ midenc compile foo.wasm -o foo.masl midenc debug foo.masl ``` -## Program Inputs +## Program inputs To pass arguments to the program on the operand stack, or via the advice provider, you have two options, depending on the needs of the program: @@ -35,7 +35,7 @@ options, depending on the needs of the program: is, the first argument you specify will be on top of the stack, and so on. 2. Specify a configuration file from which to load inputs for the program, via the `--inputs` option. -### Via Command Line +### Via command line To specify the contents of the operand stack, you can do so following the raw arguments separator `--`. Each operand must be a valid field element value, in either decimal or hexadecimal format. For example: @@ -48,7 +48,7 @@ If you pass arguments via the command line in conjunction with `--inputs`, then will be used instead of the contents of the `inputs.stack` option (if set). This lets you specify a baseline set of inputs, and then try out different arguments using the command line. -### Via Inputs Config +### Via inputs config While simply passing operands to the `midenc debug` command is useful, it only allows you to specify inputs to be passed via operand stack. To provide inputs via the advice provider, you will need to use @@ -103,7 +103,7 @@ one you get dropped into when the debugger starts. The home page contains the fo * Breakpoints - displays the set of current breakpoints, along with how many were hit at the current instruction, when relevant -### Keyboard Shortcuts +### Keyboard shortcuts On the home page, the following keyboard shortcuts are available: @@ -177,7 +177,7 @@ After a breakpoint is hit, it expires if it is one of the following types: When a breakpoint expires, it is removed from the breakpoint list on the next cycle. -## Reading Memory +## Reading memory Another useful diagnostic task is examining the contents of linear memory, to verify that expected data has been written. You can do this via the command prompt, using `r` (or `read`), followed by diff --git a/docs/usage/midenc.md b/docs/usage/midenc.md index a3530e43f..7664a39e3 100644 --- a/docs/usage/midenc.md +++ b/docs/usage/midenc.md @@ -1,4 +1,4 @@ -# Getting Started with `midenc` +# Getting started with `midenc` The `midenc` executable is the command-line interface for the compiler driver, as well as other helpful tools, such as the interactive debugger. @@ -110,7 +110,7 @@ than the default path that would have been used (`target/miden/foo.masp`). See [Debugging Programs](debugger.md) for details on using `midenc debug` to debug Miden programs. -## Next Steps +## Next steps We have put together two useful guides to walk through more detail on compiling Rust to WebAssembly: diff --git a/frontend-wasm/CHANGELOG.md b/frontend-wasm/CHANGELOG.md index f21f3400d..04f2b8e8b 100644 --- a/frontend-wasm/CHANGELOG.md +++ b/frontend-wasm/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-frontend-wasm-v0.0.6...midenc-frontend-wasm-v0.0.7) - 2024-09-17 + +### Other +- *(rustfmt)* disable wrap_comments due to broken behavior + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-frontend-wasm-v0.0.5...midenc-frontend-wasm-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-frontend-wasm-v0.0.1...midenc-frontend-wasm-v0.0.2) - 2024-08-30 ### Fixed diff --git a/frontend-wasm/src/code_translator/mod.rs b/frontend-wasm/src/code_translator/mod.rs index 64dda6ee8..a77d294ba 100644 --- a/frontend-wasm/src/code_translator/mod.rs +++ b/frontend-wasm/src/code_translator/mod.rs @@ -106,9 +106,7 @@ pub fn translate_operator( let global_index = GlobalIndex::from_u32(*global_index); let name = module.global_name(global_index); let ty = ir_type(module.globals[global_index].ty, diagnostics)?; - let ptr = builder - .ins() - .symbol_addr(name.as_str(), Ptr(ty.clone().into()), span); + let ptr = builder.ins().symbol_addr(name.as_str(), Ptr(ty.clone().into()), span); let val = state.pop1(); builder.ins().store(ptr, val, span); } @@ -126,7 +124,8 @@ pub fn translate_operator( let (arg1, arg2, cond) = state.pop3(); match ty { wasmparser::ValType::F32 => { - let cond = builder.ins().gt_imm(cond, Immediate::Felt(midenc_hir::Felt::ZERO), span); + let cond = + builder.ins().gt_imm(cond, Immediate::Felt(midenc_hir::Felt::ZERO), span); state.push1(builder.ins().select(cond, arg1, arg2, span)); } wasmparser::ValType::I32 => { @@ -146,15 +145,23 @@ pub fn translate_operator( } Operator::Nop => {} /***************************** Control flow blocks *********************************/ - Operator::Block { blockty } => translate_block(blockty, builder, state, mod_types, diagnostics, span)?, - Operator::Loop { blockty } => translate_loop(blockty, builder, state, mod_types, diagnostics, span)?, - Operator::If { blockty } => translate_if(blockty, state, builder, mod_types, diagnostics, span)?, + Operator::Block { blockty } => { + translate_block(blockty, builder, state, mod_types, diagnostics, span)? + } + Operator::Loop { blockty } => { + translate_loop(blockty, builder, state, mod_types, diagnostics, span)? + } + Operator::If { blockty } => { + translate_if(blockty, state, builder, mod_types, diagnostics, span)? + } Operator::Else => translate_else(state, builder, span)?, Operator::End => translate_end(state, builder, span), /**************************** Branch instructions *********************************/ Operator::Br { relative_depth } => translate_br(state, relative_depth, builder, span), - Operator::BrIf { relative_depth } => translate_br_if(*relative_depth, builder, state, span)?, + Operator::BrIf { relative_depth } => { + translate_br_if(*relative_depth, builder, state, span)? + } Operator::BrTable { targets } => translate_br_table(targets, state, builder, span)?, Operator::Return => translate_return(state, builder, diagnostics, span)?, /************************************ Calls ****************************************/ @@ -168,7 +175,10 @@ pub fn translate_operator( diagnostics, )?; } - Operator::CallIndirect { type_index: _, table_index: _ } => { + Operator::CallIndirect { + type_index: _, + table_index: _, + } => { // TODO: } /******************************* Memory management *********************************/ diff --git a/hir-analysis/CHANGELOG.md b/hir-analysis/CHANGELOG.md index 9f75f0667..525b46715 100644 --- a/hir-analysis/CHANGELOG.md +++ b/hir-analysis/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-analysis-v0.0.6...midenc-hir-analysis-v0.0.7) - 2024-09-17 + +### Other +- fix up new clippy warnings + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-analysis-v0.0.5...midenc-hir-analysis-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.3](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-analysis-v0.0.2...midenc-hir-analysis-v0.0.3) - 2024-08-30 ### Other diff --git a/hir-analysis/src/dominance.rs b/hir-analysis/src/dominance.rs index bd48a22e7..4655fbd9d 100644 --- a/hir-analysis/src/dominance.rs +++ b/hir-analysis/src/dominance.rs @@ -648,14 +648,14 @@ impl<'a> Iterator for ChildIter<'a> { /// the program above, that would give us the set `{block3}`: /// /// * The dominance frontier of the assignment in `block0` is empty, because `block0` strictly -/// dominates all other blocks in the program. +/// dominates all other blocks in the program. /// * The dominance frontier of the assignment in `block1` contains `block3`, because `block1` -/// dominates a predecessor of `block3` (itself), but does not strictly dominate that predecessor, -/// because a node cannot strictly dominate itself. +/// dominates a predecessor of `block3` (itself), but does not strictly dominate that predecessor, +/// because a node cannot strictly dominate itself. /// * The dominance frontier of the assignment in `block2` contains `block3`, for the same reasons -/// as `block1`. +/// as `block1`. /// * The dominance frontier of `block3` is empty, because it has no successors and thus cannot -/// dominate any other blocks. +/// dominate any other blocks. /// * The union of all the dominance frontiers is simply `{block3}` /// /// So this tells us that we need to place a phi node (a block parameter) at `block3`, and rewrite diff --git a/hir-analysis/src/liveness.rs b/hir-analysis/src/liveness.rs index 3915dea3c..fcd69ed17 100644 --- a/hir-analysis/src/liveness.rs +++ b/hir-analysis/src/liveness.rs @@ -1485,10 +1485,10 @@ mod tests { /// increase the loop depth. Additionally, we expect to see the following: /// /// * Values which are live across the outer loop, reflect the cumulative distance of the loop - /// nest, not just the outer loop. + /// nest, not just the outer loop. /// * Values which are live across the inner loop, reflect the loop distance /// * Both inner and outer loop header parameters have their live ranges end when the - /// corresponding loop is continued or exited + /// corresponding loop is continued or exited /// /// The following HIR is constructed for this test: /// diff --git a/hir-analysis/src/spill.rs b/hir-analysis/src/spill.rs index 00e88c70b..e497e161a 100644 --- a/hir-analysis/src/spill.rs +++ b/hir-analysis/src/spill.rs @@ -46,68 +46,69 @@ use crate::{ /// In reverse CFG postorder, visit each block B, and: /// /// 1. Determine initialization of W at entry to B (W^entry). W is the set of operands on the -/// operand stack. From this we are able to determine what, if any, actions are required to -/// keep |W| <= K where K is the maximum allowed operand stack depth. +/// operand stack. From this we are able to determine what, if any, actions are required to +/// keep |W| <= K where K is the maximum allowed operand stack depth. /// /// 2. Determine initialization of S at entry to B (S^entry). S is the set of values which have -/// been spilled up to that point in the program. We can use S to determine whether or not -/// to actually emit a spill instruction when a spill is necessary, as due to the SSA form of -/// the program, every value has a single definition, so we need only emit a spill for a given -/// value once. +/// been spilled up to that point in the program. We can use S to determine whether or not +/// to actually emit a spill instruction when a spill is necessary, as due to the SSA form of +/// the program, every value has a single definition, so we need only emit a spill for a given +/// value once. /// /// 3. For each predecessor P of B, determine what, if any, spills and/or reloads are needed to -/// ensure that W and S are consistent regardless of what path is taken to reach B, and that -/// |W| <= K. Depending on whether P has multiple successors, it may be necessary to split the -/// edge between P and B, so that the emitted spills/reloads only apply along that edge. +/// ensure that W and S are consistent regardless of what path is taken to reach B, and that +/// |W| <= K. Depending on whether P has multiple successors, it may be necessary to split the +/// edge between P and B, so that the emitted spills/reloads only apply along that edge. /// /// 4. Perform the MIN algorithm on B, which is used to determine spill/reloads at each instruction -/// in the block. MIN is designed to make optimal decisions about what to spill, so as to -/// minimize the number of spill/reload-related instructions executed by any given program -/// execution trace. It does this by using the next-use distance associated with values in W, -/// which is computed as part of our liveness analysis. Unlike traditional liveness analysis -/// which only tracks what is live at a given program point, next-use distances not only tell -/// you whether a value is live or dead, but how far away the next use of that value is. MIN -/// uses this information to select spill candidates from W furthest away from the current -/// instruction; and on top of this we also add an additional heuristic based on the size of -/// each candidate as represented on the operand stack. Given two values with equal next-use -/// distances, the largest candidates are spilled first, allowing us to free more operand stack -/// space with fewer spills. +/// in the block. MIN is designed to make optimal decisions about what to spill, so as to +/// minimize the number of spill/reload-related instructions executed by any given program +/// execution trace. It does this by using the next-use distance associated with values in W, +/// which is computed as part of our liveness analysis. Unlike traditional liveness analysis +/// which only tracks what is live at a given program point, next-use distances not only tell +/// you whether a value is live or dead, but how far away the next use of that value is. MIN +/// uses this information to select spill candidates from W furthest away from the current +/// instruction; and on top of this we also add an additional heuristic based on the size of +/// each candidate as represented on the operand stack. Given two values with equal next-use +/// distances, the largest candidates are spilled first, allowing us to free more operand stack +/// space with fewer spills. /// /// The MIN algorithm works as follows: /// /// 1. Starting at the top of the block, B, W is initialized with the set W^entry(B), and S with -/// S^entry(B) +/// S^entry(B) /// /// 2. For each instruction, I, in the block, update W and S according to the needs of I, while -/// attempting to preserve as many live values in W as possible. Each instruction fundamentally -/// requires that: On entry, W contains all the operands of I; on exit, W contains all of the -/// results of I; and that at all times, |W| <= K. This means that we may need to reload operands -/// of I that are not in W (because they were spilled), and we may need to spill values from W to -/// ensure that the stack depth <= K. The specific effects for I are computed as follows: -/// a. All operands of I not in W, must be reloaded in front of I, thus adding them to W. -/// This is also one means by which values are added to S, as by definition a reload -/// implies that the value must have been spilled, or it would still be in W. Thus, when -/// we emit reloads, we also ensure that the reloaded value is added to S. -/// b. If a reload would cause |W| to exceed K, we must select values in W to spill. Candidates -/// are selected from the set of values in W which are not operands of I, prioritized first -/// by greatest next-use distance, then by stack consumption, as determined by the -/// representation of the value type on the operand stack. -/// c. By definition, none of I's results can be in W directly in front of I, so we must -/// always ensure that W has sufficient capacity to hold all of I's results. The analysis -/// of sufficient capacity is somewhat subtle: -/// - Any of I's operands that are live-at I, but _not_ live-after I, do _not_ count towards -/// the operand stack usage when calculating available capacity for the results. This is -/// because those operands will be consumed, and their space can be re-used for results. -/// - Any of I's operands that are live-after I, however, _do_ count towards the stack usage -/// - If W still has insufficient capacity for all the results, we must select candidates -/// to spill. Candidates are the set of values in W which are either not operands of I, -/// or are operands of I which are live-after I. Selection criteria is the same as before. -/// d. Operands of I which are _not_ live-after I, are removed from W on exit from I, thus W -/// reflects only those values which are live at the current program point. -/// e. Lastly, when we select a value to be spilled, we only emit spill instructions for those -/// values which are not yet in S, i.e. they have not yet been spilled; and which have a -/// finite next-use distance, i.e. the value is still live. If a value to be spilled _is_ -/// in S and/or is unused after that point in the program, we can elide the spill entirely. +/// attempting to preserve as many live values in W as possible. Each instruction fundamentally +/// requires that: On entry, W contains all the operands of I; on exit, W contains all of the +/// results of I; and that at all times, |W| <= K. This means that we may need to reload operands +/// of I that are not in W (because they were spilled), and we may need to spill values from W to +/// ensure that the stack depth <= K. The specific effects for I are computed as follows: +/// a. All operands of I not in W, must be reloaded in front of I, thus adding them to W. +/// This is also one means by which values are added to S, as by definition a reload +/// implies that the value must have been spilled, or it would still be in W. Thus, when +/// we emit reloads, we also ensure that the reloaded value is added to S. +/// b. If a reload would cause |W| to exceed K, we must select values in W to spill. Candidates +/// are selected from the set of values in W which are not operands of I, prioritized first +/// by greatest next-use distance, then by stack consumption, as determined by the +/// representation of the value type on the operand stack. +/// c. By definition, none of I's results can be in W directly in front of I, so we must +/// always ensure that W has sufficient capacity to hold all of I's results. The analysis +/// of sufficient capacity is somewhat subtle: +/// - Any of I's operands that are live-at I, but _not_ live-after I, do _not_ count towards +/// the operand stack usage when calculating available capacity for the results. This is +/// because those operands will be consumed, and their space can be re-used for results. +/// - Any of I's operands that are live-after I, however, _do_ count towards the stack usage +/// - If W still has insufficient capacity for all the results, we must select candidates +/// to spill. Candidates are the set of values in W which are either not operands of I, +/// or are operands of I which are live-after I. Selection criteria is the same as before. +/// +/// d. Operands of I which are _not_ live-after I, are removed from W on exit from I, thus W +/// reflects only those values which are live at the current program point. +/// e. Lastly, when we select a value to be spilled, we only emit spill instructions for those +/// values which are not yet in S, i.e. they have not yet been spilled; and which have a +/// finite next-use distance, i.e. the value is still live. If a value to be spilled _is_ +/// in S and/or is unused after that point in the program, we can elide the spill entirely. /// /// What we've described above represents both the analysis itself, as well as the effects of /// applying that analysis to the actual control flow graph of the function. However, doing so @@ -176,23 +177,23 @@ use crate::{ /// 1. Given the set of spilled values, S, visit the dominance tree in postorder (bottom-up) /// 2. In each block, working towards the start of the block from the end, visit each instruction /// until one of the following occurs: -/// a. We find a use of a value in S. We append the use to the list of other uses of that value -/// which are awaiting a rewrite while we search for the nearest dominating definition. -/// b. We find a reload of a value in S. This reload is, by construction, the nearest dominating -/// definition for all uses of the reloaded value that we have found so far. We rewrite all of -/// those uses to reference the reloaded value, and remove them from the list. -/// c. We find the original definition of a value in S. This is similar to what happens when we -/// find a reload, except no rewrite is needed, so we simply remove all pending uses of that -/// value from the list. -/// d. We reach the top of the block. Note that block parameters are treated as definitions, so -/// those are handled first as described in the previous point. However, an additional step -/// is required here: If the current block is in the iterated dominance frontier for S, i.e. -/// for any value in S, the current block is in the dominance frontier of the original -/// definition of that value - then for each such value for which we have found at least one -/// use, we must add a new block parameter representing that value; rewrite all uses we have -/// found so far to use the block parameter instead; remove those uses from the list; and -/// lastly, rewrite the branch instruction in each predecessor to pass the value as a new block -/// argument when branching to the current block. +/// a. We find a use of a value in S. We append the use to the list of other uses of that value +/// which are awaiting a rewrite while we search for the nearest dominating definition. +/// b. We find a reload of a value in S. This reload is, by construction, the nearest dominating +/// definition for all uses of the reloaded value that we have found so far. We rewrite all of +/// those uses to reference the reloaded value, and remove them from the list. +/// c. We find the original definition of a value in S. This is similar to what happens when we +/// find a reload, except no rewrite is needed, so we simply remove all pending uses of that +/// value from the list. +/// d. We reach the top of the block. Note that block parameters are treated as definitions, so +/// those are handled first as described in the previous point. However, an additional step +/// is required here: If the current block is in the iterated dominance frontier for S, i.e. +/// for any value in S, the current block is in the dominance frontier of the original +/// definition of that value - then for each such value for which we have found at least one +/// use, we must add a new block parameter representing that value; rewrite all uses we have +/// found so far to use the block parameter instead; remove those uses from the list; and +/// lastly, rewrite the branch instruction in each predecessor to pass the value as a new block +/// argument when branching to the current block. /// 3. When we start processing a block, the union of the set of unresolved uses found in each /// successor, forms the initial state of that set for the current block. If a block has no /// successors, then the set is initially empty. This is how we propagate uses up the dominance diff --git a/hir-analysis/src/treegraph.rs b/hir-analysis/src/treegraph.rs index 1f2e617a9..c940928bd 100644 --- a/hir-analysis/src/treegraph.rs +++ b/hir-analysis/src/treegraph.rs @@ -543,14 +543,14 @@ impl TreeGraph { /// The algorithm used to produce the topological ordering is simple: /// /// 1. Seed a queue with the set of treegraph roots with no predecessors, enqueuing them - /// in their natural sort order. + /// in their natural sort order. /// 2. Pop the next root from the queue, remove all edges between that root and its - /// dependencies, - /// and add the root to the output vector. If any of the dependencies have no remaining - /// predecessors after the aforementioned edge was removed, it is added to the queue. + /// dependencies, and add the root to the output vector. If any of the dependencies have no + /// remaining predecessors after the aforementioned edge was removed, it is added to the + /// queue. /// 3. The process in step 2 is repeated until the queue is empty. /// 4. If there are any edges remaining in the graph, there was a cycle, and thus a - /// topological sort is impossible, this will result in an error being returned. + /// topological sort is impossible, this will result in an error being returned. /// 5. Otherwise, the sort is complete. /// /// In effect, a node is only emitted once all of its dependents are emitted, so for codegen, diff --git a/hir-analysis/src/validation/function.rs b/hir-analysis/src/validation/function.rs index 2ad9262f7..337b3d745 100644 --- a/hir-analysis/src/validation/function.rs +++ b/hir-analysis/src/validation/function.rs @@ -12,7 +12,7 @@ use crate::{ControlFlowGraph, DominatorTree}; /// * All blocks in the function body must be valid /// * All uses of values must be dominated by their definitions /// * All value uses must type check, i.e. branching to a block with a value -/// of a different type than declared by the block parameter is invalid. +/// of a different type than declared by the block parameter is invalid. pub struct FunctionValidator { in_kernel_module: bool, } diff --git a/hir-macros/CHANGELOG.md b/hir-macros/CHANGELOG.md index 5eaed6e9f..4abf3afa2 100644 --- a/hir-macros/CHANGELOG.md +++ b/hir-macros/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-macros-v0.0.5...midenc-hir-macros-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-macros-v0.0.1...midenc-hir-macros-v0.0.2) - 2024-08-16 ### Fixed diff --git a/hir-symbol/CHANGELOG.md b/hir-symbol/CHANGELOG.md index e3de3c7ad..e3250c8c6 100644 --- a/hir-symbol/CHANGELOG.md +++ b/hir-symbol/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-symbol-v0.0.5...midenc-hir-symbol-v0.0.6) - 2024-09-06 + +### Other +- clean up unused deps +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-symbol-v0.0.1...midenc-hir-symbol-v0.0.2) - 2024-08-28 ### Added diff --git a/hir-transform/CHANGELOG.md b/hir-transform/CHANGELOG.md index 0fe7607c2..42b0b834f 100644 --- a/hir-transform/CHANGELOG.md +++ b/hir-transform/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-transform-v0.0.6...midenc-hir-transform-v0.0.7) - 2024-09-17 + +### Other +- fix up new clippy warnings + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-transform-v0.0.5...midenc-hir-transform-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-transform-v0.0.1...midenc-hir-transform-v0.0.2) - 2024-08-28 ### Fixed diff --git a/hir-transform/src/inline_blocks.rs b/hir-transform/src/inline_blocks.rs index 64f7ef399..aa89c9522 100644 --- a/hir-transform/src/inline_blocks.rs +++ b/hir-transform/src/inline_blocks.rs @@ -21,16 +21,16 @@ use crate::adt::ScopedMap; /// /// * Due to less than optimal lowering to SSA form /// * To split critical edges in preparation for dataflow analysis and related transformations, -/// but ultimately no code introduced along those edges, and critical edges no longer present -/// an obstacle to further optimization or codegen. +/// but ultimately no code introduced along those edges, and critical edges no longer present +/// an obstacle to further optimization or codegen. /// * During treeification of the CFG, where blocks with multiple predecessors were duplicated -/// to produce a CFG in tree form, where no blocks (other than loop headers) have multiple -/// predecessors. This process removed block arguments from these blocks, and rewrote instructions -/// dominated by those block arguments to reference the values passed from the original predecessor -/// to whom the subtree is attached. This transformation can expose a chain of blocks which all have -/// a single predecessor and successor, introducing branches where none are needed, and by removing -/// those redundant branches, all of the code from blocks in the chain can be inlined in the first -/// block of the chain. +/// to produce a CFG in tree form, where no blocks (other than loop headers) have multiple +/// predecessors. This process removed block arguments from these blocks, and rewrote instructions +/// dominated by those block arguments to reference the values passed from the original +/// predecessor to whom the subtree is attached. This transformation can expose a chain of blocks +/// which all have a single predecessor and successor, introducing branches where none are needed, +/// and by removing those redundant branches, all of the code from blocks in the chain can be +/// inlined in the first block of the chain. #[derive(Default, PassInfo, ModuleRewritePassAdapter)] pub struct InlineBlocks; impl RewritePass for InlineBlocks { @@ -132,7 +132,7 @@ impl RewritePass for InlineBlocks { analyses.mark_preserved::(&function.id); } - session.print(&function, Self::FLAG).into_diagnostic()?; + session.print(&*function, Self::FLAG).into_diagnostic()?; if session.should_print_cfg(Self::FLAG) { use std::io::Write; let cfg = function.cfg_printer(); diff --git a/hir-transform/src/spill.rs b/hir-transform/src/spill.rs index 1b7e66ad5..b9e69ae10 100644 --- a/hir-transform/src/spill.rs +++ b/hir-transform/src/spill.rs @@ -65,7 +65,7 @@ impl RewritePass for ApplySpills { // Apply the above collectively rewrites.apply(function, analyses, session)?; - session.print(&function, Self::FLAG).into_diagnostic()?; + session.print(&*function, Self::FLAG).into_diagnostic()?; if session.should_print_cfg(Self::FLAG) { use std::io::Write; let cfg = function.cfg_printer(); @@ -283,13 +283,13 @@ impl RewritePass for InsertSpills { /// the CFG (i.e. bottom-up): /// /// * We need to find uses of spilled values as we encounter them, and keep track of them until -/// we find an appropriate definition for each use. +/// we find an appropriate definition for each use. /// * We need to propagate uses up the dominance tree until all uses are matched with definitions /// * We need to rewrite uses when we find a definition /// * We need to identify whether a block we are about to leave (on our way up the CFG), is in -/// the iterated dominance frontier for the set of spilled values we've found uses for. If it is, -/// we must append a new block parameter, rewrite the terminator of any predecessor blocks, and -/// rewrite all uses found so far by using the new block parameter as the dominating definition. +/// the iterated dominance frontier for the set of spilled values we've found uses for. If it is, +/// we must append a new block parameter, rewrite the terminator of any predecessor blocks, and +/// rewrite all uses found so far by using the new block parameter as the dominating definition. /// /// Technically, this pass could be generalized a step further, such that it fixes up invalid /// def-use relationships in general, rather than just the narrow case of spills/reloads - but it is @@ -299,8 +299,8 @@ impl RewritePass for InsertSpills { /// /// 1. No `spill` or `reload` instructions remain in the IR /// 2. The semantics of the original IR on which [InsertSpills] was run, will be preserved, if: -/// * The original IR was valid -/// * No modification to the IR was made between [InsertSpills] and [RewriteSpills] +/// * The original IR was valid +/// * No modification to the IR was made between [InsertSpills] and [RewriteSpills] /// 3. The resulting function, once compiled to Miden Assembly, will keep the operand stack depth <= /// 16 elements, so long as the schedule produced by the backend preserves the scheduling /// semantics. For example, spills/reloads are computed based on an implied scheduling of diff --git a/hir-transform/src/split_critical_edges.rs b/hir-transform/src/split_critical_edges.rs index a9201137f..1cef2d1e9 100644 --- a/hir-transform/src/split_critical_edges.rs +++ b/hir-transform/src/split_critical_edges.rs @@ -135,7 +135,7 @@ impl RewritePass for SplitCriticalEdges { analyses.insert(function.id, cfg); - session.print(&function, Self::FLAG).into_diagnostic()?; + session.print(&*function, Self::FLAG).into_diagnostic()?; if session.should_print_cfg(Self::FLAG) { use std::io::Write; let cfg = function.cfg_printer(); diff --git a/hir-transform/src/treeify.rs b/hir-transform/src/treeify.rs index a0775b748..5f2920bb3 100644 --- a/hir-transform/src/treeify.rs +++ b/hir-transform/src/treeify.rs @@ -44,11 +44,11 @@ use crate::adt::ScopedMap; /// 2. For each P, clone B to a new block B', and rewrite P such that it branches to B' rather than /// B. /// 3. For each successor S of B: -/// a. If S is a loop header, and S appears before B in the reverse postorder sort of the CFG, -/// then it is a loopback edge, so the corresponding edge from B' to S is left intact. -/// b. If S is a loop header, but S appears after B in the reverse postorder sort of the CFG, -/// then it is treated like other blocks (see c.) -/// c. Otherwise, clone S to S', and rewrite B' to branch to S' instead of S. +/// a. If S is a loop header, and S appears before B in the reverse postorder sort of the CFG, +/// then it is a loopback edge, so the corresponding edge from B' to S is left intact. +/// b. If S is a loop header, but S appears after B in the reverse postorder sort of the CFG, +/// then it is treated like other blocks (see c.) +/// c. Otherwise, clone S to S', and rewrite B' to branch to S' instead of S. /// 4. Repeat step 2 for the successors of S, recursively, until the subgraph reachable from B /// /// Since we are treeifying blocks from the leaves of the CFG to the root, and because we do not @@ -250,7 +250,7 @@ use crate::adt::ScopedMap; /// * Duplicate loop headers on control flow edges leading to those headers /// * Emit N `push.0` instructions on control flow edges exiting the function from a loop depth of N /// * Emit a combination of the above on control flow edges exiting an inner loop for an outer loop, -/// depending on what depths the predecessor and successor blocks are at +/// depending on what depths the predecessor and successor blocks are at /// /// ```text,ignore /// blk0 @@ -441,7 +441,7 @@ impl RewritePass for Treeify { } } - session.print(&function, Self::FLAG).into_diagnostic()?; + session.print(&*function, Self::FLAG).into_diagnostic()?; if session.should_print_cfg(Self::FLAG) { use std::io::Write; let cfg = function.cfg_printer(); diff --git a/hir-type/CHANGELOG.md b/hir-type/CHANGELOG.md index 8c9ab55f4..1e3a442a9 100644 --- a/hir-type/CHANGELOG.md +++ b/hir-type/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-type-v0.0.6...midenc-hir-type-v0.0.7) - 2024-09-17 + +### Other +- fix up new clippy warnings + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-type-v0.0.5...midenc-hir-type-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.3](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-type-v0.0.2...midenc-hir-type-v0.0.3) - 2024-08-30 ### Fixed diff --git a/hir-type/src/layout.rs b/hir-type/src/layout.rs index 93d9783c4..8b13f094c 100644 --- a/hir-type/src/layout.rs +++ b/hir-type/src/layout.rs @@ -42,13 +42,13 @@ impl Type { /// Split this type into two parts: /// /// * The first part is no more than `n` bytes in size, and may contain the type itself if it - /// fits + /// fits /// * The second part is None if the first part is smaller than or equal in size to the - /// requested split size + /// requested split size /// * The second part is Some if there is data left in the original type after the split. This - /// part will be a type that attempts to preserve, to the extent possible, the original type - /// structure, but will fall back to an array of bytes if a larger type must be split down - /// the middle somewhere. + /// part will be a type that attempts to preserve, to the extent possible, the original type + /// structure, but will fall back to an array of bytes if a larger type must be split down + /// the middle somewhere. pub fn split(self, n: usize) -> (Type, Option) { if n == 0 { return (self, None); diff --git a/hir/CHANGELOG.md b/hir/CHANGELOG.md index ad75680fb..104006b93 100644 --- a/hir/CHANGELOG.md +++ b/hir/CHANGELOG.md @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-v0.0.6...midenc-hir-v0.0.7) - 2024-09-17 + +### Other +- fix up new clippy warnings + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-hir-v0.0.5...midenc-hir-v0.0.6) - 2024-09-06 + +### Other +- clean up unused deps +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-hir-v0.0.1...midenc-hir-v0.0.2) - 2024-08-28 ### Added diff --git a/hir/src/asm/builder.rs b/hir/src/asm/builder.rs index b8e519a4e..103d9c131 100644 --- a/hir/src/asm/builder.rs +++ b/hir/src/asm/builder.rs @@ -386,10 +386,10 @@ impl<'a> MasmOpBuilder<'a> { /// /// 1. There is a value of boolean type on top of the operand stack /// 2. The abstract state of the operand stack, assuming the boolean just mentioned - /// has been popped, must be consistent with the state of the operand stack when the - /// loop was entered, as well as if the loop was skipped due to the conditional being - /// false. The abstract state referred to here is the number, and type, of the elements - /// on the operand stack. + /// has been popped, must be consistent with the state of the operand stack when the + /// loop was entered, as well as if the loop was skipped due to the conditional being + /// false. The abstract state referred to here is the number, and type, of the elements + /// on the operand stack. /// /// Both of these are validated by [LoopBuilder], and a panic is raised if validation fails. pub fn while_true(self, span: SourceSpan) -> LoopBuilder<'a> { @@ -1411,10 +1411,9 @@ pub struct LoopBuilder<'a> { /// `while.true`, we must validate two things: /// /// 1. That the top of the stack holds a boolean value - /// 2. That after popping the boolean, the output state of the operand stack - /// matches the input state in number and type of elements. This is required, - /// as otherwise program behavior is undefined based on whether the loop is - /// entered or not. + /// 2. That after popping the boolean, the output state of the operand stack matches the input + /// state in number and type of elements. This is required, as otherwise program behavior is + /// undefined based on whether the loop is entered or not. out_stack: OperandStack, /// The source span associated with the loop span: SourceSpan, diff --git a/hir/src/component/mod.rs b/hir/src/component/mod.rs index d74250924..81f9df164 100644 --- a/hir/src/component/mod.rs +++ b/hir/src/component/mod.rs @@ -342,7 +342,7 @@ impl<'a> ComponentBuilder<'a> { /// /// * `build` will add the module to the [ComponentBuilder] directly, rather than returning it /// * `function` will delegate to [ComponentFunctionBuilder] which plays a similar role to this -/// struct, but for [ModuleFunctionBuilder]. +/// struct, but for [ModuleFunctionBuilder]. pub struct ComponentModuleBuilder<'a, 'b: 'a> { cb: &'a mut ComponentBuilder<'b>, mb: ModuleBuilder, diff --git a/hir/src/function.rs b/hir/src/function.rs index 18b4f5975..5dbcc76e1 100644 --- a/hir/src/function.rs +++ b/hir/src/function.rs @@ -357,19 +357,17 @@ pub type FunctionList = LinkedList; /// /// * Functions may have zero or more parameters, and produce zero or more results. /// * Functions are namespaced in [Module]s. You may define a function separately from a module, -/// to aid in parallelizing compilation, but functions must be attached to a module prior to code -/// generation. Furthermore, in order to reference other functions, you must do so using their -/// fully-qualified names. +/// to aid in parallelizing compilation, but functions must be attached to a module prior to code +/// generation. Furthermore, in order to reference other functions, you must do so using their +/// fully-qualified names. /// * Functions consist of one or more basic blocks, where the entry block is predefined based -/// on the function signature. +/// on the function signature. /// * Basic blocks consist of a sequence of [Instruction] without any control flow (excluding -/// calls), -/// terminating with a control flow instruction. Our SSA representation uses block arguments rather -/// than phi nodes to represent join points in the control flow graph. +/// calls), terminating with a control flow instruction. Our SSA representation uses block +/// arguments rather than phi nodes to represent join points in the control flow graph. /// * Instructions consume zero or more arguments, and produce zero or more results. Results -/// produced -/// by an instruction constitute definitions of those values. A value may only ever have a single -/// definition, e.g. you can't reassign a value after it is introduced by an instruction. +/// produced by an instruction constitute definitions of those values. A value may only ever have +/// a single definition, e.g. you can't reassign a value after it is introduced by an instruction. /// /// References to functions and global variables from a [Function] are not fully validated until /// link-time/code generation. diff --git a/hir/src/layout.rs b/hir/src/layout.rs index 729dc7e82..cdb0d0116 100644 --- a/hir/src/layout.rs +++ b/hir/src/layout.rs @@ -58,24 +58,21 @@ intrusive_adapter!(pub LayoutAdapter = UnsafeRef>: Layout /// # Pros /// /// * Once allocated, values stored in the map have a stable location, this can be useful for when -/// you -/// expect to store elements of the map in an intrusive collection. +/// you expect to store elements of the map in an intrusive collection. /// * Keys can be more efficiently sized, i.e. rather than pointers/usize keys, you can choose -/// arbitrarily -/// small bitwidths, as long as there is sufficient keyspace for your use case. +/// arbitrarily small bitwidths, as long as there is sufficient keyspace for your use case. /// * Attempt to keep data in the map as contiguous in memory as possible. This is again useful for -/// when -/// the data is also linked into an intrusive collection, like a linked list, where traversing the -/// list will end up visiting many of the nodes in the map. If each node was its own Box, this would -/// cause thrashing of the cache - ArenaMap sidesteps this by allocating values in chunks of memory -/// that are friendlier to the cache. +/// when the data is also linked into an intrusive collection, like a linked list, where +/// traversing the list will end up visiting many of the nodes in the map. If each node was its +/// own Box, this would cause thrashing of the cache - ArenaMap sidesteps this by allocating +/// values in chunks of memory that are friendlier to the cache. /// /// # Cons /// /// * Memory allocated for data stored in the map is not released until the map is dropped. This is -/// a tradeoff made to ensure that the data has a stable location in memory, but the flip side of -/// that is increased memory usage for maps that stick around for a long time. In our case, these -/// maps are relatively short-lived, so it isn't a problem in practice. +/// a tradeoff made to ensure that the data has a stable location in memory, but the flip side of +/// that is increased memory usage for maps that stick around for a long time. In our case, these +/// maps are relatively short-lived, so it isn't a problem in practice. /// * It doesn't provide as rich of an API as HashMap and friends pub struct ArenaMap { keys: Vec>>, @@ -237,8 +234,7 @@ impl IndexMut for ArenaMap { /// * It is a doubly-linked list, so you can traverse equally efficiently front-to-back or /// back-to-front, /// * It has O(1) indexing; given a key, we can directly obtain a reference to a node, and with -/// that, -/// obtain a cursor over the list starting at that node. +/// that, obtain a cursor over the list starting at that node. pub struct OrderedArenaMap { list: LinkedList>, map: ArenaMap>, diff --git a/hir/src/module.rs b/hir/src/module.rs index a832bcaf7..ff90c3858 100644 --- a/hir/src/module.rs +++ b/hir/src/module.rs @@ -47,7 +47,8 @@ impl<'a> intrusive_collections::KeyAdapter<'a> for ModuleTreeAdapter { /// Represents a SSA IR module /// -/// These correspond to MASM modules +/// These correspond to MASM modules. +/// /// This module is largely a container for functions, but it also provides /// as the owner for pooled resources available to functions: /// @@ -91,10 +92,10 @@ pub struct Module { /// /// * Functions with external linkage are required to use the `Kernel` calling convention. /// * A kernel module executes in the root context of the Miden VM, allowing one to expose - /// functionality - /// that is protected from tampering by other non-kernel functions in the program. + /// functionality that is protected from tampering by other non-kernel functions in the + /// program. /// * Due to the above, you may not reference globals outside the kernel module, from within - /// kernel functions, as they are not available in the root context. + /// kernel functions, as they are not available in the root context. is_kernel: bool, } impl fmt::Display for Module { @@ -497,8 +498,7 @@ impl Module { /// NOTE: This function will panic if either of the following rules are violated: /// /// * If this module is a kernel module, public functions must use the kernel calling - /// convention, - /// however private functions can use any convention. + /// convention, however private functions can use any convention. /// * If this module is not a kernel module, functions may not use the kernel calling convention pub fn push(&mut self, function: Box) -> Result<(), SymbolConflictError> { assert_valid_function!(self, function); diff --git a/hir/src/program/linker.rs b/hir/src/program/linker.rs index 5dee42e98..5aba0cf82 100644 --- a/hir/src/program/linker.rs +++ b/hir/src/program/linker.rs @@ -74,36 +74,34 @@ impl From<(Ident, Vec)> for Object { /// following: /// /// * Determines the final layout of all code and data in the executable or library being produced, -/// this allows the linker to know the absolute and/or relative address for every symbol in the -/// program. +/// this allows the linker to know the absolute and/or relative address for every symbol in the +/// program. /// * Ensures that all referenced symbols (functions/globals) are defined, or that there are runtime -/// dependencies that will satisfy the missing symbols (in practice, what actually happens is the -/// static linker, i.e. `ld`, assumes missing symbols will be provided by the runtime dependencies, -/// and it is the runtime dynamic linker, i.e. `rtdyld`, which handles the case where those symbols -/// cannot be located when the program is starting up). +/// dependencies that will satisfy the missing symbols (in practice, what actually happens is the +/// static linker, i.e. `ld`, assumes missing symbols will be provided by the runtime +/// dependencies, and it is the runtime dynamic linker, i.e. `rtdyld`, which handles the case +/// where those symbols cannot be located when the program is starting up). /// * Rewrites instructions with symbol references to use the absolute/relative addressing once the -/// layout of the program in memory is known. +/// layout of the program in memory is known. /// * Emits the linked program in binary form, either as an executable or as a library /// /// However, there a couple of things that make [Linker] somewhat different than your typical system /// linker: /// /// * We do not emit assembly/run the assembler prior to linking. This is because Miden Assembly -/// (MASM) -/// does not have a way to represent things like data segments or global variables natively. -/// Instead, the linker is responsible for laying those out in memory ahead of time, and then all -/// operations involving them are lowered to use absolute addresses. +/// (MASM) does not have a way to represent things like data segments or global variables +/// natively. Instead, the linker is responsible for laying those out in memory ahead of time, and +/// then all operations involving them are lowered to use absolute addresses. /// * [Linker] does not emit the final binary form of the program. It still plans the layout of -/// program data -/// in memory, and performs the same type of validations as a typical linker, but the output of the -/// linker is a [Program], which must be emitted as Miden Assembly in a separate step _after_ being -/// linked. +/// program data in memory, and performs the same type of validations as a typical linker, but the +/// output of the linker is a [Program], which must be emitted as Miden Assembly in a separate +/// step _after_ being linked. /// * We cannot guarantee that the [Program] we emit constitutes a closed set of modules/functions, -/// even -/// accounting for functions whose definitions will be provided at runtime. This is because the -/// Miden VM acts as the final assembler of the programs it runs, and if the [Program] we emit is -/// used as a library, we can't know what other modules might end up being linked into the final -/// program run by the VM. As a result, it is assumed that any code introduced separately is either: +/// even accounting for functions whose definitions will be provided at runtime. This is because +/// the Miden VM acts as the final assembler of the programs it runs, and if the [Program] we emit +/// is used as a library, we can't know what other modules might end up being linked into the +/// final program run by the VM. As a result, it is assumed that any code introduced separately is +/// either: /// 1. memory-agnostic, i.e. it doesn't use the heap and/or make any assumptions about the heap /// layout. /// 2. compatible with the layout decided upon by the linker, i.e. it uses well-known allocator @@ -113,11 +111,11 @@ impl From<(Ident, Vec)> for Object { /// "unmanaged" memory allocations, to support scenarios whereby a linked library is used with /// a program that needs its own region of heap to manage. /// * Miden has separate address spaces depending on the context in which a function is executed, -/// i.e. the root -/// vs user context distinction. Currently, all programs are assumed to be executed in the root -/// context, and we do not provide instructions for executing calls in another context. However, we -/// will eventually be linking programs which have a potentially unbounded number of address spaces, -/// which is an additional complication that your typical linker doesn't have to deal with +/// i.e. the root vs user context distinction. Currently, all programs are assumed to be executed +/// in the root context, and we do not provide instructions for executing calls in another +/// context. However, we will eventually be linking programs which have a potentially unbounded +/// number of address spaces, which is an additional complication that your typical linker doesn't +/// have to deal with pub struct Linker<'a> { diagnostics: &'a DiagnosticsHandler, /// This is the program being constructed by the linker diff --git a/hir/src/program/mod.rs b/hir/src/program/mod.rs index 159629cbb..0e0425c28 100644 --- a/hir/src/program/mod.rs +++ b/hir/src/program/mod.rs @@ -312,7 +312,7 @@ impl<'a> ProgramBuilder<'a> { /// /// * `build` will add the module to the [ProgramBuilder] directly, rather than returning it /// * `function` will delegate to [ProgramFunctionBuilder] which plays a similar role to this -/// struct, but for [ModuleFunctionBuilder]. +/// struct, but for [ModuleFunctionBuilder]. pub struct ProgramModuleBuilder<'a, 'b: 'a> { pb: &'a mut ProgramBuilder<'b>, mb: ModuleBuilder, diff --git a/midenc-compile/CHANGELOG.md b/midenc-compile/CHANGELOG.md index 802602b21..72fe84aa9 100644 --- a/midenc-compile/CHANGELOG.md +++ b/midenc-compile/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-compile-v0.0.5...midenc-compile-v0.0.6) - 2024-09-06 + +### Fixed +- *(driver)* ensure mast/masl outputs are emitted on request + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.1](https://github.com/0xPolygonMiden/compiler/compare/midenc-compile-v0.0.0...midenc-compile-v0.0.1) - 2024-07-18 ### Added diff --git a/midenc-debug/CHANGELOG.md b/midenc-debug/CHANGELOG.md index 34e5c50a7..c5f890fa4 100644 --- a/midenc-debug/CHANGELOG.md +++ b/midenc-debug/CHANGELOG.md @@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-debug-v0.0.6...midenc-debug-v0.0.7) - 2024-09-17 + +### Other +- update rust toolchain + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-debug-v0.0.5...midenc-debug-v0.0.6) - 2024-09-06 + +### Added +- implement 'midenc run' command + +### Other +- revisit/update documentation and guides +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-debug-v0.0.1...midenc-debug-v0.0.2) - 2024-08-30 ### Fixed diff --git a/midenc-debug/src/lib.rs b/midenc-debug/src/lib.rs index 2e29ad95d..b410f0732 100644 --- a/midenc-debug/src/lib.rs +++ b/midenc-debug/src/lib.rs @@ -1,5 +1,4 @@ #![feature(iter_array_chunks)] -#![feature(lazy_cell)] #![allow(unused)] mod cli; diff --git a/midenc-driver/CHANGELOG.md b/midenc-driver/CHANGELOG.md index bec878574..6f2d1624c 100644 --- a/midenc-driver/CHANGELOG.md +++ b/midenc-driver/CHANGELOG.md @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-driver-v0.0.5...midenc-driver-v0.0.6) - 2024-09-06 + +### Added +- implement 'midenc run' command + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.1](https://github.com/0xPolygonMiden/compiler/compare/midenc-driver-v0.0.0...midenc-driver-v0.0.1) - 2024-07-18 ### Added diff --git a/midenc-session/CHANGELOG.md b/midenc-session/CHANGELOG.md index 2f8805ea4..3ec61bea9 100644 --- a/midenc-session/CHANGELOG.md +++ b/midenc-session/CHANGELOG.md @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-session-v0.0.6...midenc-session-v0.0.7) - 2024-09-17 + +### Other +- update rust toolchain + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-session-v0.0.5...midenc-session-v0.0.6) - 2024-09-06 + +### Fixed +- *(driver)* incorrect extension for masl output type + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.4](https://github.com/0xPolygonMiden/compiler/compare/midenc-session-v0.0.3...midenc-session-v0.0.4) - 2024-08-30 ### Other diff --git a/midenc-session/Cargo.toml b/midenc-session/Cargo.toml index 241dc9947..5062d75d5 100644 --- a/midenc-session/Cargo.toml +++ b/midenc-session/Cargo.toml @@ -27,7 +27,7 @@ miden-core.workspace = true miden-stdlib.workspace = true midenc-hir-symbol.workspace = true midenc-hir-macros.workspace = true -miden-base-sys = { version = "0.0.5", path = "../sdk/base-sys", features = [ +miden-base-sys = { version = "0.0.7", path = "../sdk/base-sys", features = [ "masl-lib", ] } parking_lot = { workspace = true, optional = true } diff --git a/midenc-session/src/lib.rs b/midenc-session/src/lib.rs index 8548ad6f5..6adf6854f 100644 --- a/midenc-session/src/lib.rs +++ b/midenc-session/src/lib.rs @@ -1,6 +1,4 @@ #![feature(debug_closure_helpers)] -#![feature(lazy_cell)] -#![feature(error_in_core)] #![no_std] extern crate alloc; diff --git a/midenc/CHANGELOG.md b/midenc/CHANGELOG.md index 48a906b33..889664b5c 100644 --- a/midenc/CHANGELOG.md +++ b/midenc/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/midenc-v0.0.6...midenc-v0.0.7) - 2024-09-17 + +### Other +- update Cargo.lock dependencies + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/midenc-v0.0.5...midenc-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/midenc-v0.0.1...midenc-v0.0.2) - 2024-08-30 ### Other diff --git a/mkdocs.yml b/mkdocs.yml index e6dc1b227..fb9334e2d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,24 +21,25 @@ theme: - content.action.edit nav: - - Getting Started: index.md + - Getting started: index.md - Usage: - midenc: usage/midenc.md - cargo miden: usage/cargo-miden.md - Guides: - Rust To WebAssembly: guides/rust_to_wasm.md - WebAssembly To Miden Assembly: guides/wasm_to_masm.md - - Developing Miden Programs In Rust: guides/develop_miden_in_rust.md - - Developing Miden Rollup Accounts And Note Scripts In Rust: guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md - - Debugging Programs: usage/debugger.md - - Compiler Architecture: + - Developing Miden programs In Rust: guides/develop_miden_in_rust.md + - Developing Miden rollup accounts and note scripts In Rust: guides/develop_miden_rollup_accounts_and_note_scripts_in_rust.md + - Debugging programs: usage/debugger.md + - Compiler architecture: - Overview: design/overview.md - - Supported Frontends: design/frontends.md + - Supported front ends: design/frontends.md #- HIR: #- Code Generation: #- Testing: - Appendices: - - Calling Conventions: appendix/calling_conventions.md + - Known limitations: appendix/known-limitations.md + - Calling conventions: appendix/calling-conventions.md - Canonical ABI vs Miden ABI: appendix/canonabi-adhocabi-mismatch.md markdown_extensions: diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e6723a7bf..20984a060 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-05-07" +channel = "nightly-2024-08-06" components = ["rustfmt", "rust-src", "clippy"] targets = ["wasm32-unknown-unknown", "wasm32-wasip1"] profile = "minimal" diff --git a/rustfmt.toml b/rustfmt.toml index 728b941b1..bda0a2327 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -2,7 +2,7 @@ edition = "2021" array_width = 80 chain_width = 80 comment_width = 100 -wrap_comments = true +wrap_comments = false fn_call_width = 80 reorder_modules = true reorder_imports = true diff --git a/sdk/alloc/CHANGELOG.md b/sdk/alloc/CHANGELOG.md index 6ebc4fb3d..a108f2699 100644 --- a/sdk/alloc/CHANGELOG.md +++ b/sdk/alloc/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/miden-sdk-alloc-v0.0.5...miden-sdk-alloc-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/miden-sdk-alloc-v0.0.1...miden-sdk-alloc-v0.0.2) - 2024-08-30 ### Other diff --git a/sdk/base-sys/CHANGELOG.md b/sdk/base-sys/CHANGELOG.md index dfd2b89fc..f9432167e 100644 --- a/sdk/base-sys/CHANGELOG.md +++ b/sdk/base-sys/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/miden-base-sys-v0.0.6...miden-base-sys-v0.0.7) - 2024-09-17 + +### Other +- remove `miden-assembly` dependency from `sdk/base-sys` for `bindings` feature + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/miden-base-sys-v0.0.5...miden-base-sys-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.3](https://github.com/0xPolygonMiden/compiler/compare/miden-base-sys-v0.0.2...miden-base-sys-v0.0.3) - 2024-08-30 ### Other diff --git a/sdk/base-sys/Cargo.toml b/sdk/base-sys/Cargo.toml index 7faea6d7b..acfbb11a6 100644 --- a/sdk/base-sys/Cargo.toml +++ b/sdk/base-sys/Cargo.toml @@ -14,11 +14,11 @@ readme.workspace = true edition.workspace = true [dependencies] -miden-assembly.workspace = true -miden-stdlib-sys = { version = "0.0.5", path = "../stdlib-sys", optional = true } +miden-assembly = { workspace = true, optional = true } +miden-stdlib-sys = { version = "0.0.7", path = "../stdlib-sys", optional = true } [build-dependencies] -miden-assembly.workspace = true +miden-assembly = { workspace = true, optional = true } [features] default = [] @@ -26,4 +26,4 @@ default = [] # User facing Rust bindings "bindings" = ["dep:miden-stdlib-sys"] # MASL library for Miden rollup (tx kernel, etc.) used by the compiler in the link phase -"masl-lib" = [] +"masl-lib" = ["dep:miden-assembly"] diff --git a/sdk/base-sys/build.rs b/sdk/base-sys/build.rs index 8f9dcaad8..d4a90c4a0 100644 --- a/sdk/base-sys/build.rs +++ b/sdk/base-sys/build.rs @@ -1,12 +1,11 @@ -use std::{env, path::Path, sync::Arc}; - -use miden_assembly::{ - diagnostics::{IntoDiagnostic, Result}, - Assembler, Library as CompiledLibrary, LibraryNamespace, -}; - /// Read and parse the contents from `./masm/*` and compile it to MASL. -fn main() -> Result<()> { +#[cfg(feature = "masl-lib")] +fn main() { + use std::{env, path::Path, sync::Arc}; + + use miden_assembly::{ + diagnostics::IntoDiagnostic, Assembler, Library as CompiledLibrary, LibraryNamespace, + }; // re-build the `[OUT_DIR]/assets/` file iff something in the `./masm` directory // or its builder changed: println!("cargo:rerun-if-changed=masm"); @@ -19,12 +18,13 @@ fn main() -> Result<()> { let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx"); let asm = Assembler::new(source_manager); - let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, asm)?; + let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, asm).unwrap(); let tx_masl_path = build_dir .join("assets") .join("tx") .with_extension(CompiledLibrary::LIBRARY_EXTENSION); - txlib.write_to_file(tx_masl_path).into_diagnostic()?; - - Ok(()) + txlib.write_to_file(tx_masl_path).into_diagnostic().unwrap(); } + +#[cfg(not(feature = "masl-lib"))] +fn main() {} diff --git a/sdk/sdk/CHANGELOG.md b/sdk/sdk/CHANGELOG.md index b559ff270..602fdc177 100644 --- a/sdk/sdk/CHANGELOG.md +++ b/sdk/sdk/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/miden-sdk-v0.0.5...miden-sdk-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/miden-sdk-v0.0.1...miden-sdk-v0.0.2) - 2024-08-30 ### Other diff --git a/sdk/sdk/Cargo.toml b/sdk/sdk/Cargo.toml index a743e751b..4e8550ea6 100644 --- a/sdk/sdk/Cargo.toml +++ b/sdk/sdk/Cargo.toml @@ -15,6 +15,6 @@ edition.workspace = true crate-type = ["rlib"] [dependencies] -miden-sdk-alloc = { version = "0.0.5", path = "../alloc" } -miden-stdlib-sys = { version = "0.0.5", path = "../stdlib-sys" } -miden-base-sys = { version = "0.0.5", path = "../base-sys", features = ["bindings"] } +miden-sdk-alloc = { version = "0.0.7", path = "../alloc" } +miden-stdlib-sys = { version = "0.0.7", path = "../stdlib-sys" } +miden-base-sys = { version = "0.0.7", path = "../base-sys", features = ["bindings"] } diff --git a/sdk/stdlib-sys/CHANGELOG.md b/sdk/stdlib-sys/CHANGELOG.md index d41447319..51ff2e147 100644 --- a/sdk/stdlib-sys/CHANGELOG.md +++ b/sdk/stdlib-sys/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/miden-stdlib-sys-v0.0.5...miden-stdlib-sys-v0.0.6) - 2024-09-06 + +### Other +- switch all crates to a single workspace version (0.0.5) + ## [0.0.3](https://github.com/0xPolygonMiden/compiler/compare/miden-stdlib-sys-v0.0.2...miden-stdlib-sys-v0.0.3) - 2024-08-30 ### Fixed diff --git a/tests/integration/Cargo.toml b/tests/integration/Cargo.toml index b36a1b631..706e855c7 100644 --- a/tests/integration/Cargo.toml +++ b/tests/integration/Cargo.toml @@ -31,6 +31,7 @@ midenc-codegen-masm.workspace = true midenc-session.workspace = true midenc-compile.workspace = true midenc-debug.workspace = true +cargo-miden.workspace = true wasmprinter = "0.2.80" proptest.workspace = true sha2 = "0.10" diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir index 64e441a26..16cb9a16e 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir @@ -177,58 +177,59 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v4)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 4)) - (let (v34 u32) (bitcast v32)) + (let (v29 u32) (bitcast v4)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 4)) (let (v35 u32) (bitcast v33)) - (let (v36 u32) (shr.wrapping v34 v35)) - (let (v37 i32) (bitcast v36)) - (let [(v38 i32) (v39 i32)] (call (#miden::note #get_inputs) v37)) - (let (v40 u32) (bitcast v0)) - (let (v41 u32) (add.checked v40 8)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (store v43 v38) - (let (v44 u32) (bitcast v0)) - (let (v45 u32) (add.checked v44 4)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (store v47 v32) - (let (v48 u32) (bitcast v0)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (store v50 v14) - (let (v51 i32) (const.i32 16)) - (let (v52 i32) (add.wrapping v4 v51)) - (let (v53 (ptr i32)) (global.symbol #__stack_pointer)) - (store v53 v52) + (let (v36 u32) (bitcast v34)) + (let (v37 u32) (shr.wrapping v35 v36)) + (let (v38 i32) (bitcast v37)) + (let [(v39 i32) (v40 i32)] (call (#miden::note #get_inputs) v38)) + (let (v41 u32) (bitcast v0)) + (let (v42 u32) (add.checked v41 8)) + (let (v43 u32) (mod.unchecked v42 4)) + (assertz 250 v43) + (let (v44 (ptr i32)) (inttoptr v42)) + (store v44 v39) + (let (v45 u32) (bitcast v0)) + (let (v46 u32) (add.checked v45 4)) + (let (v47 u32) (mod.unchecked v46 4)) + (assertz 250 v47) + (let (v48 (ptr i32)) (inttoptr v46)) + (store v48 v33) + (let (v49 u32) (bitcast v0)) + (let (v50 u32) (mod.unchecked v49 4)) + (assertz 250 v50) + (let (v51 (ptr i32)) (inttoptr v49)) + (store v51 v14) + (let (v52 i32) (const.i32 16)) + (let (v53 i32) (add.wrapping v4 v52)) + (let (v54 (ptr i32)) (global.symbol #__stack_pointer)) + (store v54 v53) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v4)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v4)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm index ed2b96ea5..f96d217e3 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm @@ -63,7 +63,8 @@ export."miden_base_sys::bindings::tx::get_inputs" movup.2 u32div.16 exec.::intrinsics::mem::load_sw - eq.0 + push.1 + neq neq.0 if.true dup.1 diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat index 23e004675..435d4d2c0 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat @@ -101,7 +101,6 @@ return end unreachable - unreachable ) (func $miden_base_sys::bindings::tx::get_inputs (;6;) (type 2) (param i32) (local i32 i32 i32) @@ -122,7 +121,8 @@ block ;; label = @1 local.get 1 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 2 local.get 1 @@ -225,7 +225,6 @@ ) (func $alloc::raw_vec::handle_error (;8;) (type 6) (param i32 i32) unreachable - unreachable ) (table (;0;) 1 1 funcref) (memory (;0;) 17) diff --git a/tests/integration/expected/components/add_wasm_component.hir b/tests/integration/expected/components/add_wasm_component.hir index 2f034ae9f..9935425c3 100644 --- a/tests/integration/expected/components/add_wasm_component.hir +++ b/tests/integration/expected/components/add_wasm_component.hir @@ -2,7 +2,7 @@ ;; Modules (module #add_wasm_component ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -19,9 +19,18 @@ (ret)) ) + (func (export #add_wasm_component::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048584)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -33,7 +42,7 @@ (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048580)) + (let (v6 i32) (const.i32 1048584)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -58,7 +67,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048584)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -103,7 +112,7 @@ (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048588)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) @@ -118,7 +127,7 @@ (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048589)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -138,7 +147,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048589)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -835,8 +844,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -847,61 +856,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -909,173 +900,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) diff --git a/tests/integration/expected/components/add_wasm_component.wat b/tests/integration/expected/components/add_wasm_component.wat index 1034420f1..218186cbd 100644 --- a/tests/integration/expected/components/add_wasm_component.wat +++ b/tests/integration/expected/components/add_wasm_component.wat @@ -6,16 +6,17 @@ (type (;3;) (func (param i32 i32 i32) (result i32))) (type (;4;) (func (param i32 i32 i32 i32))) (func $__wasm_call_ctors (;0;) (type 0)) - (func $__rust_alloc (;1;) (type 1) (param i32 i32) (result i32) - i32.const 1048580 + (func $add_wasm_component::bindings::__link_custom_section_describing_imports (;1;) (type 0)) + (func $__rust_alloc (;2;) (type 1) (param i32 i32) (result i32) + i32.const 1048584 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;2;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048580 + i32.const 1048584 local.get 2 local.get 3 call $::alloc @@ -31,7 +32,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048584 local.get 0 local.get 2 local.get 1 @@ -39,13 +40,13 @@ end local.get 4 ) - (func $miden:add-package/add-interface@1.0.0#add (;3;) (type 1) (param i32 i32) (result i32) + (func $miden:add-package/add-interface@1.0.0#add (;4;) (type 1) (param i32 i32) (result i32) call $wit_bindgen_rt::run_ctors_once local.get 1 local.get 0 i32.add ) - (func $wit_bindgen_rt::cabi_realloc (;4;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;5;) (type 2) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 @@ -55,7 +56,7 @@ i32.eqz br_if 2 (;@1;) i32.const 0 - i32.load8_u offset=1048584 + i32.load8_u offset=1048588 drop local.get 3 local.get 2 @@ -73,22 +74,21 @@ local.get 2 br_if 0 (;@1;) unreachable - unreachable end local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;5;) (type 0) + (func $wit_bindgen_rt::run_ctors_once (;6;) (type 0) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048589 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048589 end ) - (func $wee_alloc::alloc_first_fit (;6;) (type 3) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;7;) (type 3) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -393,7 +393,7 @@ end i32.const 0 ) - (func $::alloc (;7;) (type 3) (param i32 i32 i32) (result i32) + (func $::alloc (;8;) (type 3) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -497,7 +497,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;8;) (type 4) (param i32 i32 i32 i32) + (func $::dealloc (;9;) (type 4) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -527,39 +527,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -640,18 +623,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -670,22 +663,22 @@ i32.store end ) - (func $cabi_realloc (;9;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;10;) (type 2) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:add-package/add-interface@1.0.0#add" (func $miden:add-package/add-interface@1.0.0#add)) (export "cabi_realloc" (func $cabi_realloc)) (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (elem (;0;) (i32.const 1) func $add_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) diff --git a/tests/integration/expected/components/inc_wasm_component.hir b/tests/integration/expected/components/inc_wasm_component.hir index a3c5cbb78..fab68e3f4 100644 --- a/tests/integration/expected/components/inc_wasm_component.hir +++ b/tests/integration/expected/components/inc_wasm_component.hir @@ -5,7 +5,7 @@ ;; Modules (module #inc_wasm_component ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -22,9 +22,18 @@ (ret)) ) + (func (export #inc_wasm_component::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048584)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -36,7 +45,7 @@ (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048580)) + (let (v6 i32) (const.i32 1048584)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -61,7 +70,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048584)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -106,7 +115,7 @@ (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048588)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) @@ -121,7 +130,7 @@ (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048589)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -141,7 +150,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048589)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -838,8 +847,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -850,61 +859,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -912,173 +903,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) diff --git a/tests/integration/expected/components/inc_wasm_component.wat b/tests/integration/expected/components/inc_wasm_component.wat index bd5c00de8..1e52129d8 100644 --- a/tests/integration/expected/components/inc_wasm_component.wat +++ b/tests/integration/expected/components/inc_wasm_component.wat @@ -15,16 +15,17 @@ (type (;5;) (func (param i32 i32 i32 i32))) (import "miden:add-package/add-interface@1.0.0" "add" (func $inc_wasm_component::bindings::miden::add_package::add_interface::add::wit_import (;0;) (type 0))) (func $__wasm_call_ctors (;1;) (type 1)) - (func $__rust_alloc (;2;) (type 0) (param i32 i32) (result i32) - i32.const 1048580 + (func $inc_wasm_component::bindings::__link_custom_section_describing_imports (;2;) (type 1)) + (func $__rust_alloc (;3;) (type 0) (param i32 i32) (result i32) + i32.const 1048584 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;4;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048580 + i32.const 1048584 local.get 2 local.get 3 call $::alloc @@ -40,7 +41,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048584 local.get 0 local.get 2 local.get 1 @@ -48,13 +49,13 @@ end local.get 4 ) - (func $inc (;4;) (type 3) (param i32) (result i32) + (func $inc (;5;) (type 3) (param i32) (result i32) call $wit_bindgen_rt::run_ctors_once local.get 0 i32.const 1 call $inc_wasm_component::bindings::miden::add_package::add_interface::add::wit_import ) - (func $wit_bindgen_rt::cabi_realloc (;5;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;6;) (type 2) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 @@ -64,7 +65,7 @@ i32.eqz br_if 2 (;@1;) i32.const 0 - i32.load8_u offset=1048584 + i32.load8_u offset=1048588 drop local.get 3 local.get 2 @@ -82,22 +83,21 @@ local.get 2 br_if 0 (;@1;) unreachable - unreachable end local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;6;) (type 1) + (func $wit_bindgen_rt::run_ctors_once (;7;) (type 1) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048589 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048589 end ) - (func $wee_alloc::alloc_first_fit (;7;) (type 4) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;8;) (type 4) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -402,7 +402,7 @@ end i32.const 0 ) - (func $::alloc (;8;) (type 4) (param i32 i32 i32) (result i32) + (func $::alloc (;9;) (type 4) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -506,7 +506,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;9;) (type 5) (param i32 i32 i32 i32) + (func $::dealloc (;10;) (type 5) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -536,39 +536,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -649,18 +632,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -679,22 +672,22 @@ i32.store end ) - (func $cabi_realloc (;10;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;11;) (type 2) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "inc" (func $inc)) (export "cabi_realloc" (func $cabi_realloc)) (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (elem (;0;) (i32.const 1) func $inc_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") ) (alias export 0 "add" (func (;0;))) (core func (;0;) (canon lower (func 0))) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir index 72a2e81c9..e32e397f6 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir @@ -748,58 +748,59 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v4)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 4)) - (let (v34 u32) (bitcast v32)) + (let (v29 u32) (bitcast v4)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 4)) (let (v35 u32) (bitcast v33)) - (let (v36 u32) (shr.wrapping v34 v35)) - (let (v37 i32) (bitcast v36)) - (let [(v38 i32) (v39 i32)] (call (#miden::note #get_inputs) v37)) - (let (v40 u32) (bitcast v0)) - (let (v41 u32) (add.checked v40 8)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (store v43 v38) - (let (v44 u32) (bitcast v0)) - (let (v45 u32) (add.checked v44 4)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (store v47 v32) - (let (v48 u32) (bitcast v0)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (store v50 v14) - (let (v51 i32) (const.i32 16)) - (let (v52 i32) (add.wrapping v4 v51)) - (let (v53 (ptr i32)) (global.symbol #__stack_pointer)) - (store v53 v52) + (let (v36 u32) (bitcast v34)) + (let (v37 u32) (shr.wrapping v35 v36)) + (let (v38 i32) (bitcast v37)) + (let [(v39 i32) (v40 i32)] (call (#miden::note #get_inputs) v38)) + (let (v41 u32) (bitcast v0)) + (let (v42 u32) (add.checked v41 8)) + (let (v43 u32) (mod.unchecked v42 4)) + (assertz 250 v43) + (let (v44 (ptr i32)) (inttoptr v42)) + (store v44 v39) + (let (v45 u32) (bitcast v0)) + (let (v46 u32) (add.checked v45 4)) + (let (v47 u32) (mod.unchecked v46 4)) + (assertz 250 v47) + (let (v48 (ptr i32)) (inttoptr v46)) + (store v48 v33) + (let (v49 u32) (bitcast v0)) + (let (v50 u32) (mod.unchecked v49 4)) + (assertz 250 v50) + (let (v51 (ptr i32)) (inttoptr v49)) + (store v51 v14) + (let (v52 i32) (const.i32 16)) + (let (v53 i32) (add.wrapping v4 v52)) + (let (v54 (ptr i32)) (global.symbol #__stack_pointer)) + (store v54 v53) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v4)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v4)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) @@ -978,53 +979,54 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v5)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 0)) - (let (v34 u32) (bitcast v0)) - (let (v35 u32) (add.checked v34 8)) - (let (v36 u32) (mod.unchecked v35 4)) - (assertz 250 v36) - (let (v37 (ptr i32)) (inttoptr v35)) - (store v37 v33) - (let (v38 u32) (bitcast v0)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 4)) - (assertz 250 v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (store v41 v32) - (let (v42 u32) (bitcast v0)) - (let (v43 u32) (mod.unchecked v42 4)) - (assertz 250 v43) - (let (v44 (ptr i32)) (inttoptr v42)) - (store v44 v14) - (let (v45 i32) (const.i32 16)) - (let (v46 i32) (add.wrapping v5 v45)) - (let (v47 (ptr i32)) (global.symbol #__stack_pointer)) - (store v47 v46) + (let (v29 u32) (bitcast v5)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 0)) + (let (v35 u32) (bitcast v0)) + (let (v36 u32) (add.checked v35 8)) + (let (v37 u32) (mod.unchecked v36 4)) + (assertz 250 v37) + (let (v38 (ptr i32)) (inttoptr v36)) + (store v38 v34) + (let (v39 u32) (bitcast v0)) + (let (v40 u32) (add.checked v39 4)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i32)) (inttoptr v40)) + (store v42 v33) + (let (v43 u32) (bitcast v0)) + (let (v44 u32) (mod.unchecked v43 4)) + (assertz 250 v44) + (let (v45 (ptr i32)) (inttoptr v43)) + (store v45 v14) + (let (v46 i32) (const.i32 16)) + (let (v47 i32) (add.wrapping v5 v46)) + (let (v48 (ptr i32)) (global.symbol #__stack_pointer)) + (store v48 v47) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v5)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v5)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat index 5c4540ee7..35b85aa4d 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat @@ -487,7 +487,6 @@ return end unreachable - unreachable ) (func $miden_base_sys::bindings::tx::get_id (;45;) (type 12) (result f32) call $miden_base_sys::bindings::tx::externs::extern_account_get_id @@ -511,7 +510,8 @@ block ;; label = @1 local.get 1 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 2 local.get 1 @@ -602,7 +602,8 @@ block ;; label = @1 local.get 2 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 1 local.get 2 @@ -867,7 +868,6 @@ ) (func $alloc::raw_vec::handle_error (;56;) (type 19) (param i32 i32) unreachable - unreachable ) (func $get_wallet_magic_number.command_export (;57;) (type 12) (result f32) call $get_wallet_magic_number diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir index 31f31e274..b4b9e1f26 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir @@ -40,7 +40,7 @@ (module #basic_wallet ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000001000000010000000100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -57,9 +57,18 @@ (ret)) ) + (func (export #basic_wallet::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048596)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -71,7 +80,7 @@ (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048580)) + (let (v6 i32) (const.i32 1048596)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -96,7 +105,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048596)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -176,55 +185,51 @@ (ret)) ) - (func (export #cabi_realloc_wit_bindgen_0_28_0) + (func (export #wit_bindgen_rt::cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i1) (neq v1 0)) - (condbr v5 (block 5) (block 6))) - - (block 1 (param v4 i32)) + (condbr v5 (block 4) (block 5))) - (block 2 - (unreachable)) + (block 1 (param v4 i32) + (ret v4)) - (block 3 (param v21 i32) - (ret v21)) + (block 2 (param v19 i32) + (br (block 1 v19))) - (block 4 (param v17 i32) - (let (v18 i1) (eq v17 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 2) (block 8))) + (block 3 (param v17 i32) + (let (v18 i1) (neq v17 0)) + (condbr v18 (block 2 v17) (block 7))) - (block 5 + (block 4 (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 4 v16))) + (br (block 3 v16))) - (block 6 + (block 5 (let (v6 i1) (eq v3 0)) (let (v7 i32) (zext v6)) (let (v8 i1) (neq v7 0)) - (condbr v8 (block 3 v2) (block 7))) + (condbr v8 (block 2 v2) (block 6))) - (block 7 + (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048600)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 4 v15))) + (br (block 3 v15))) - (block 8 - (br (block 3 v17))) + (block 7 + (unreachable)) ) (func (export #wit_bindgen_rt::run_ctors_once) (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048601)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -244,7 +249,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048601)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -941,8 +946,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -953,61 +958,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -1015,179 +1002,187 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #cabi_realloc_wit_bindgen_0_28_0 v0 v1 v2 v3)) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) (br (block 1 v5))) (block 1 (param v4 i32) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat index db91242af..b15c11285 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat @@ -60,16 +60,17 @@ (import "miden:base/account@1.0.0" "remove-asset" (func $basic_wallet::bindings::miden::base::account::remove_asset::wit_import (;1;) (type 0))) (import "miden:base/tx@1.0.0" "create-note" (func $basic_wallet::bindings::miden::base::tx::create_note::wit_import (;2;) (type 1))) (func $__wasm_call_ctors (;3;) (type 2)) - (func $__rust_alloc (;4;) (type 3) (param i32 i32) (result i32) - i32.const 1048580 + (func $basic_wallet::bindings::__link_custom_section_describing_imports (;4;) (type 2)) + (func $__rust_alloc (;5;) (type 3) (param i32 i32) (result i32) + i32.const 1048596 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;5;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;6;) (type 4) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048580 + i32.const 1048596 local.get 2 local.get 3 call $::alloc @@ -85,7 +86,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048596 local.get 0 local.get 2 local.get 1 @@ -93,7 +94,7 @@ end local.get 4 ) - (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;6;) (type 5) (param i64 i64 i64 i64) + (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;7;) (type 5) (param i64 i64 i64 i64) (local i32) global.get $__stack_pointer i32.const 32 @@ -112,7 +113,7 @@ i32.add global.set $__stack_pointer ) - (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;7;) (type 6) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) + (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;8;) (type 6) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) (local i32) global.get $__stack_pointer i32.const 32 @@ -146,54 +147,49 @@ i32.add global.set $__stack_pointer ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;8;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;9;) (type 4) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1048584 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) local.get 3 - call $__rust_realloc + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1048600 + drop + local.get 3 + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;9;) (type 2) + (func $wit_bindgen_rt::run_ctors_once (;10;) (type 2) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048601 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048601 end ) - (func $wee_alloc::alloc_first_fit (;10;) (type 7) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;11;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -498,7 +494,7 @@ end i32.const 0 ) - (func $::alloc (;11;) (type 7) (param i32 i32 i32) (result i32) + (func $::alloc (;12;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -602,7 +598,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;12;) (type 8) (param i32 i32 i32 i32) + (func $::dealloc (;13;) (type 8) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -632,39 +628,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -745,18 +724,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -775,23 +764,23 @@ i32.store end ) - (func $cabi_realloc (;13;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;14;) (type 4) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:basic-wallet/basic-wallet@1.0.0#receive-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset)) (export "miden:basic-wallet/basic-wallet@1.0.0#send-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $basic_wallet::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00") ) (core module (;1;) (type (;0;) (func (param i64 i64 i64 i64 i32))) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir index fbc1fef55..1cab550a3 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir @@ -30,7 +30,7 @@ (module #basic_wallet_p2id_note ;; Data Segments - (data (mut) (offset 1048576) 0x0100000004000000040000000200000046656c74696e6e6572000000030000000800000008000000040000004163636f756e744964000000030000000800000008000000050000007372632f6c69622e72730000480010000a000000210000002c000000480010000a0000002400000009000000060000000b00000000000000010000000c000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000008800100020000000a8001000120000003d3d213d6d617463686573617373657274696f6e20606c6566742020726967687460206661696c65640a20206c6566743a200a2072696768743a2000d700100010000000e700100017000000fe0010000900000020726967687460206661696c65643a200a20206c6566743a20000000d70010001000000020011000100000003001100009000000fe001000090000003a2000000d0000000c000000040000000e0000000f0000001000000020202020207b202c20207b0a2c0a7d207d6c6962726172792f636f72652f7372632f666d742f6e756d2e7273890110001b00000069000000170000003078303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393972616e676520737461727420696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682000007e021000120000009002100022000000) + (data (mut) (offset 1048576) 0x000000000400000004000000010000000200000046656c7400000000080000000800000003000000696e6e65724163636f756e74496400000000000008000000080000000400000002000000020000000200000002000000020000007372632f6c69622e727300005c0010000a000000210000002c0000005c0010000a000000240000000900000005000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000008c00100020000000ac001000120000003d3d213d6d617463686573617373657274696f6e20606c6566742020726967687460206661696c65640a20206c6566743a200a2072696768743a2000db00100010000000eb00100017000000020110000900000020726967687460206661696c65643a200a20206c6566743a20000000db001000100000002401100010000000340110000900000002011000090000003a200000000000000c000000040000000a0000000b0000000c00000020202020207b202c20207b0a2c0a7d207d636f72652f7372632f666d742f6e756d2e72738d0110001300000066000000170000003078303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393972616e676520737461727420696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682000007a021000120000008c02100022000000) ;; Constants (const (id 0) 0x00100000) @@ -63,12 +63,12 @@ (let (v11 i32) (load v10)) (let (v12 i32) (const.i32 8)) (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048620)) + (let (v14 i32) (const.i32 1048621)) (let (v15 i32) (const.i32 9)) (call #core::fmt::Formatter::debug_struct v13 v1 v14 v15) (let (v16 i32) (const.i32 8)) (let (v17 i32) (add.wrapping v6 v16)) - (let (v18 i32) (const.i32 1048596)) + (let (v18 i32) (const.i32 1048616)) (let (v19 i32) (const.i32 5)) (let (v20 i32) (const.i32 1048632)) (let (v21 i32) (call #core::fmt::builders::DebugStruct::field v17 v18 v19 v11 v20)) @@ -120,24 +120,6 @@ (ret v15)) ) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId>) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) - - (block 1 - (ret)) - ) - (func (export #core::panicking::assert_failed) (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) @@ -166,7 +148,7 @@ (let (v20 i32) (const.i32 12)) (let (v21 i32) (add.wrapping v6 v20)) (let (v22 i32) (const.i32 1048576)) - (let (v23 i32) (const.i32 1048676)) + (let (v23 i32) (const.i32 1048696)) (call #core::panicking::assert_failed_inner v16 v18 v19 v21 v22 v2 v23) (unreachable)) @@ -196,14 +178,14 @@ (store v7 v6) (let (v8 i32) (const.i32 8)) (let (v9 i32) (add.wrapping v6 v8)) - (let (v10 i32) (const.i32 1048592)) + (let (v10 i32) (const.i32 1048596)) (let (v11 i32) (const.i32 4)) (call #core::fmt::Formatter::debug_struct v9 v1 v10 v11) (let (v12 i32) (const.i32 8)) (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048596)) + (let (v14 i32) (const.i32 1048616)) (let (v15 i32) (const.i32 5)) - (let (v16 i32) (const.i32 1048604)) + (let (v16 i32) (const.i32 1048600)) (let (v17 i32) (call #core::fmt::builders::DebugStruct::field v13 v14 v15 v0 v16)) (let (v18 i32) (call #core::fmt::builders::DebugStruct::finish v17)) (let (v19 i32) (const.i32 16)) @@ -216,9 +198,18 @@ (ret v2)) ) + (func (export #basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1049284)) + (let (v3 i32) (const.i32 1049280)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -230,7 +221,7 @@ (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1049284)) + (let (v6 i32) (const.i32 1049280)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -255,7 +246,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1049284)) + (let (v21 i32) (const.i32 1049280)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -314,7 +305,7 @@ (block 3 (let (v115 i32) (const.i32 0)) (let (v116 i32) (const.i32 0)) - (let (v117 i32) (const.i32 1048660)) + (let (v117 i32) (const.i32 1048680)) (call #core::panicking::panic_bounds_check v115 v116 v117) (unreachable)) @@ -372,7 +363,7 @@ (condbr v58 (block 6 v26 v18 v5) (block 7))) (block 6 (param v102 i32) (param v105 i32) (param v110 i32) - (let (v101 i32) (const.i32 1049284)) + (let (v101 i32) (const.i32 1049280)) (let (v104 i32) (const.i32 8)) (let (v107 i32) (const.i32 3)) (let (v108 u32) (bitcast v107)) @@ -437,7 +428,7 @@ (condbr v93 (block 8 v89 v90 v95 v97 v103 v106 v111) (block 10))) (block 9 - (let (v94 i32) (const.i32 1049284)) + (let (v94 i32) (const.i32 1049280)) (let (v96 i32) (const.i32 8)) (let (v98 i32) (const.i32 5)) (let (v99 u32) (bitcast v98)) @@ -449,55 +440,51 @@ (br (block 9))) ) - (func (export #cabi_realloc_wit_bindgen_0_28_0) + (func (export #wit_bindgen_rt::cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) (let (v5 i1) (neq v1 0)) - (condbr v5 (block 5) (block 6))) + (condbr v5 (block 4) (block 5))) - (block 1 (param v4 i32)) - - (block 2 - (unreachable)) + (block 1 (param v4 i32) + (ret v4)) - (block 3 (param v21 i32) - (ret v21)) + (block 2 (param v19 i32) + (br (block 1 v19))) - (block 4 (param v17 i32) - (let (v18 i1) (eq v17 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 2) (block 8))) + (block 3 (param v17 i32) + (let (v18 i1) (neq v17 0)) + (condbr v18 (block 2 v17) (block 7))) - (block 5 + (block 4 (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 4 v16))) + (br (block 3 v16))) - (block 6 + (block 5 (let (v6 i1) (eq v3 0)) (let (v7 i32) (zext v6)) (let (v8 i1) (neq v7 0)) - (condbr v8 (block 3 v2) (block 7))) + (condbr v8 (block 2 v2) (block 6))) - (block 7 + (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1049288)) + (let (v11 u32) (add.checked v10 1049284)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 4 v15))) + (br (block 3 v15))) - (block 8 - (br (block 3 v17))) + (block 7 + (unreachable)) ) (func (export #wit_bindgen_rt::run_ctors_once) (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1049289)) + (let (v2 u32) (add.checked v1 1049285)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -517,7 +504,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1049289)) + (let (v12 u32) (add.checked v11 1049285)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -1214,8 +1201,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -1226,61 +1213,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -1288,191 +1257,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) - - (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) - - (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) + (let (v79 u32) (bitcast v75)) (let (v80 u32) (mod.unchecked v79 4)) (assertz 250 v80) (let (v81 (ptr i32)) (inttoptr v79)) (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) - - (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) - ) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) + (block 17 + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) - (block 1 - (ret)) - ) + (block 18 + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) + (block 19 + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - (block 1 - (ret)) + (block 20 + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #core::panicking::panic_fmt) @@ -1484,44 +1443,60 @@ (let (v5 i32) (sub.wrapping v3 v4)) (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) (store v6 v5) - (let (v7 i32) (const.i32 1)) - (let (v8 u32) (bitcast v7)) - (let (v9 u16) (trunc v8)) - (let (v10 u32) (bitcast v5)) - (let (v11 u32) (add.checked v10 28)) - (let (v12 u32) (mod.unchecked v11 2)) + (let (v7 i32) (const.i32 16)) + (let (v8 i32) (add.wrapping v5 v7)) + (let (v9 i32) (const.i32 16)) + (let (v10 i32) (add.wrapping v0 v9)) + (let (v11 u32) (bitcast v10)) + (let (v12 u32) (mod.unchecked v11 4)) (assertz 250 v12) - (let (v13 (ptr u16)) (inttoptr v11)) - (store v13 v9) - (let (v14 u32) (bitcast v5)) - (let (v15 u32) (add.checked v14 24)) - (let (v16 u32) (mod.unchecked v15 4)) + (let (v13 (ptr i64)) (inttoptr v11)) + (let (v14 i64) (load v13)) + (let (v15 u32) (bitcast v8)) + (let (v16 u32) (mod.unchecked v15 8)) (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v1) - (let (v18 u32) (bitcast v5)) - (let (v19 u32) (add.checked v18 20)) - (let (v20 u32) (mod.unchecked v19 4)) - (assertz 250 v20) - (let (v21 (ptr i32)) (inttoptr v19)) - (store v21 v0) - (let (v22 i32) (const.i32 1048696)) - (let (v23 u32) (bitcast v5)) - (let (v24 u32) (add.checked v23 16)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (store v26 v22) - (let (v27 i32) (const.i32 1)) - (let (v28 u32) (bitcast v5)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (store v31 v27) - (let (v32 i32) (const.i32 12)) - (let (v33 i32) (add.wrapping v5 v32)) - (call #rust_begin_unwind v33) + (let (v17 (ptr i64)) (inttoptr v15)) + (store v17 v14) + (let (v18 i32) (const.i32 8)) + (let (v19 i32) (add.wrapping v5 v18)) + (let (v20 i32) (const.i32 8)) + (let (v21 i32) (add.wrapping v0 v20)) + (let (v22 u32) (bitcast v21)) + (let (v23 u32) (mod.unchecked v22 4)) + (assertz 250 v23) + (let (v24 (ptr i64)) (inttoptr v22)) + (let (v25 i64) (load v24)) + (let (v26 u32) (bitcast v19)) + (let (v27 u32) (mod.unchecked v26 8)) + (assertz 250 v27) + (let (v28 (ptr i64)) (inttoptr v26)) + (store v28 v25) + (let (v29 i32) (const.i32 1)) + (let (v30 u32) (bitcast v29)) + (let (v31 u16) (trunc v30)) + (let (v32 u32) (bitcast v5)) + (let (v33 u32) (add.checked v32 28)) + (let (v34 u32) (mod.unchecked v33 2)) + (assertz 250 v34) + (let (v35 (ptr u16)) (inttoptr v33)) + (store v35 v31) + (let (v36 u32) (bitcast v5)) + (let (v37 u32) (add.checked v36 24)) + (let (v38 u32) (mod.unchecked v37 4)) + (assertz 250 v38) + (let (v39 (ptr i32)) (inttoptr v37)) + (store v39 v1) + (let (v40 u32) (bitcast v0)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i64)) (inttoptr v40)) + (let (v43 i64) (load v42)) + (let (v44 u32) (bitcast v5)) + (let (v45 u32) (mod.unchecked v44 8)) + (assertz 250 v45) + (let (v46 (ptr i64)) (inttoptr v44)) + (store v46 v43) + (call #rust_begin_unwind v5) (unreachable)) (block 1) @@ -1529,15 +1504,6 @@ (func (export #core::slice::index::slice_start_index_len_fail) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (call #core::slice::index::slice_start_index_len_fail_rt v0 v1 v2) - (unreachable)) - - (block 1) - ) - - (func (export #core::panicking::panic_bounds_check) - (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (let (v3 i32) (const.i32 0)) (let (v4 i64) (const.i64 0)) @@ -1547,16 +1513,16 @@ (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) (store v8 v7) (let (v9 u32) (bitcast v7)) - (let (v10 u32) (add.checked v9 4)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (store v12 v1) - (let (v13 u32) (bitcast v7)) + (let (v10 u32) (mod.unchecked v9 4)) + (assertz 250 v10) + (let (v11 (ptr i32)) (inttoptr v9)) + (store v11 v0) + (let (v12 u32) (bitcast v7)) + (let (v13 u32) (add.checked v12 4)) (let (v14 u32) (mod.unchecked v13 4)) (assertz 250 v14) (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) + (store v15 v1) (let (v16 i32) (const.i32 2)) (let (v17 u32) (bitcast v7)) (let (v18 u32) (add.checked v17 12)) @@ -1564,7 +1530,7 @@ (assertz 250 v19) (let (v20 (ptr i32)) (inttoptr v18)) (store v20 v16) - (let (v21 i32) (const.i32 1048764)) + (let (v21 i32) (const.i32 1049264)) (let (v22 u32) (bitcast v7)) (let (v23 u32) (add.checked v22 8)) (let (v24 u32) (mod.unchecked v23 4)) @@ -1578,26 +1544,26 @@ (assertz 250 v29) (let (v30 (ptr i64)) (inttoptr v28)) (store v30 v26) - (let (v31 i32) (const.i32 7)) + (let (v31 i32) (const.i32 6)) (let (v32 u32) (bitcast v31)) (let (v33 u64) (zext v32)) (let (v34 i64) (bitcast v33)) (let (v35 i64) (const.i64 32)) (let (v36 u32) (cast v35)) (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 u32) (bitcast v7)) - (let (v39 u64) (zext v38)) - (let (v40 i64) (bitcast v39)) - (let (v41 i64) (bor v37 v40)) - (let (v42 u32) (bitcast v7)) - (let (v43 u32) (add.checked v42 40)) - (let (v44 u32) (mod.unchecked v43 8)) - (assertz 250 v44) - (let (v45 (ptr i64)) (inttoptr v43)) - (store v45 v41) - (let (v46 i32) (const.i32 4)) - (let (v47 i32) (add.wrapping v7 v46)) - (let (v48 u32) (bitcast v47)) + (let (v38 i32) (const.i32 4)) + (let (v39 i32) (add.wrapping v7 v38)) + (let (v40 u32) (bitcast v39)) + (let (v41 u64) (zext v40)) + (let (v42 i64) (bitcast v41)) + (let (v43 i64) (bor v37 v42)) + (let (v44 u32) (bitcast v7)) + (let (v45 u32) (add.checked v44 40)) + (let (v46 u32) (mod.unchecked v45 8)) + (assertz 250 v46) + (let (v47 (ptr i64)) (inttoptr v45)) + (store v47 v43) + (let (v48 u32) (bitcast v7)) (let (v49 u64) (zext v48)) (let (v50 i64) (bitcast v49)) (let (v51 i64) (bor v37 v50)) @@ -1623,159 +1589,247 @@ (block 1) ) - (func (export #core::fmt::Formatter::pad) - (param i32) (param i32) (param i32) (result i32) + (func (export #core::panicking::panic_bounds_check) + (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) + (let (v3 i32) (const.i32 0)) + (let (v4 i64) (const.i64 0)) + (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v6 i32) (const.i32 48)) + (let (v7 i32) (sub.wrapping v5 v6)) + (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) + (store v8 v7) + (let (v9 u32) (bitcast v7)) + (let (v10 u32) (add.checked v9 4)) + (let (v11 u32) (mod.unchecked v10 4)) + (assertz 250 v11) + (let (v12 (ptr i32)) (inttoptr v10)) + (store v12 v1) + (let (v13 u32) (bitcast v7)) + (let (v14 u32) (mod.unchecked v13 4)) + (assertz 250 v14) + (let (v15 (ptr i32)) (inttoptr v13)) + (store v15 v0) + (let (v16 i32) (const.i32 2)) + (let (v17 u32) (bitcast v7)) + (let (v18 u32) (add.checked v17 12)) + (let (v19 u32) (mod.unchecked v18 4)) + (assertz 250 v19) + (let (v20 (ptr i32)) (inttoptr v18)) + (store v20 v16) + (let (v21 i32) (const.i32 1048768)) + (let (v22 u32) (bitcast v7)) + (let (v23 u32) (add.checked v22 8)) + (let (v24 u32) (mod.unchecked v23 4)) + (assertz 250 v24) + (let (v25 (ptr i32)) (inttoptr v23)) + (store v25 v21) + (let (v26 i64) (const.i64 2)) + (let (v27 u32) (bitcast v7)) + (let (v28 u32) (add.checked v27 20)) + (let (v29 u32) (mod.unchecked v28 4)) + (assertz 250 v29) + (let (v30 (ptr i64)) (inttoptr v28)) + (store v30 v26) + (let (v31 i32) (const.i32 6)) + (let (v32 u32) (bitcast v31)) + (let (v33 u64) (zext v32)) + (let (v34 i64) (bitcast v33)) + (let (v35 i64) (const.i64 32)) + (let (v36 u32) (cast v35)) + (let (v37 i64) (shl.wrapping v34 v36)) + (let (v38 u32) (bitcast v7)) + (let (v39 u64) (zext v38)) + (let (v40 i64) (bitcast v39)) + (let (v41 i64) (bor v37 v40)) + (let (v42 u32) (bitcast v7)) + (let (v43 u32) (add.checked v42 40)) + (let (v44 u32) (mod.unchecked v43 8)) + (assertz 250 v44) + (let (v45 (ptr i64)) (inttoptr v43)) + (store v45 v41) + (let (v46 i32) (const.i32 4)) + (let (v47 i32) (add.wrapping v7 v46)) + (let (v48 u32) (bitcast v47)) + (let (v49 u64) (zext v48)) + (let (v50 i64) (bitcast v49)) + (let (v51 i64) (bor v37 v50)) + (let (v52 u32) (bitcast v7)) + (let (v53 u32) (add.checked v52 32)) + (let (v54 u32) (mod.unchecked v53 8)) + (assertz 250 v54) + (let (v55 (ptr i64)) (inttoptr v53)) + (store v55 v51) + (let (v56 i32) (const.i32 32)) + (let (v57 i32) (add.wrapping v7 v56)) + (let (v58 u32) (bitcast v7)) + (let (v59 u32) (add.checked v58 16)) + (let (v60 u32) (mod.unchecked v59 4)) + (assertz 250 v60) + (let (v61 (ptr i32)) (inttoptr v59)) + (store v61 v57) + (let (v62 i32) (const.i32 8)) + (let (v63 i32) (add.wrapping v7 v62)) + (call #core::panicking::panic_fmt v63 v2) + (unreachable)) + + (block 1) + ) + + (func (export #core::fmt::Formatter::pad) + (param i32) (param i32) (param i32) (result i32) + (block 0 (param v0 i32) (param v1 i32) (param v2 i32) + (let (v4 i32) (const.i32 0)) (let (v5 u32) (bitcast v0)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 u32) (bitcast v0)) - (let (v10 u32) (add.checked v9 8)) + (let (v6 u32) (add.checked v5 8)) + (let (v7 u32) (mod.unchecked v6 4)) + (assertz 250 v7) + (let (v8 (ptr i32)) (inttoptr v6)) + (let (v9 i32) (load v8)) + (let (v10 u32) (bitcast v0)) (let (v11 u32) (mod.unchecked v10 4)) (assertz 250 v11) (let (v12 (ptr i32)) (inttoptr v10)) (let (v13 i32) (load v12)) - (let (v14 i32) (bor v8 v13)) - (let (v15 i1) (eq v14 0)) - (let (v16 i32) (zext v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 2) (block 3))) + (let (v14 i1) (neq v13 0)) + (condbr v14 (block 3 v9 v1 v2 v0 v13) (block 4))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v479 u32) (bitcast v0)) - (let (v480 u32) (add.checked v479 20)) - (let (v481 u32) (mod.unchecked v480 4)) - (assertz 250 v481) - (let (v482 (ptr i32)) (inttoptr v480)) - (let (v483 i32) (load v482)) - (let (v484 u32) (bitcast v0)) - (let (v485 u32) (add.checked v484 24)) - (let (v486 u32) (mod.unchecked v485 4)) - (assertz 250 v486) - (let (v487 (ptr i32)) (inttoptr v485)) - (let (v488 i32) (load v487)) - (let (v489 u32) (bitcast v488)) - (let (v490 u32) (add.checked v489 12)) - (let (v491 u32) (mod.unchecked v490 4)) - (assertz 250 v491) - (let (v492 (ptr i32)) (inttoptr v490)) - (let (v493 i32) (load v492)) - (br (block 1 v493))) + (let (v415 u32) (bitcast v0)) + (let (v416 u32) (add.checked v415 20)) + (let (v417 u32) (mod.unchecked v416 4)) + (assertz 250 v417) + (let (v418 (ptr i32)) (inttoptr v416)) + (let (v419 i32) (load v418)) + (let (v420 u32) (bitcast v0)) + (let (v421 u32) (add.checked v420 24)) + (let (v422 u32) (mod.unchecked v421 4)) + (assertz 250 v422) + (let (v423 (ptr i32)) (inttoptr v421)) + (let (v424 i32) (load v423)) + (let (v425 u32) (bitcast v424)) + (let (v426 u32) (add.checked v425 12)) + (let (v427 u32) (mod.unchecked v426 4)) + (assertz 250 v427) + (let (v428 (ptr i32)) (inttoptr v426)) + (let (v429 i32) (load v428)) + (br (block 1 v429))) (block 3 - (let (v18 i1) (eq v13 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 4 v8 v0 v1 v2) (block 5))) + (param v20 i32) + (param v26 i32) + (param v27 i32) + (param v29 i32) + (param v145 i32) + (let (v21 i32) (const.i32 1)) + (let (v22 i32) (band v20 v21)) + (let (v23 i1) (eq v22 0)) + (let (v24 i32) (zext v23)) + (let (v25 i1) (neq v24 0)) + (condbr v25 (block 6 v145 v29 v26 v27) (block 7))) (block 4 - (param v213 i32) - (param v220 i32) - (param v231 i32) - (param v233 i32) - (let (v219 i1) (neq v213 0)) - (condbr v219 (block 33) (block 34))) + (let (v15 i32) (const.i32 1)) + (let (v16 i32) (band v9 v15)) + (let (v17 i1) (eq v16 0)) + (let (v18 i32) (zext v17)) + (let (v19 i1) (neq v18 0)) + (condbr v19 (block 2) (block 5))) (block 5 - (let (v21 i32) (add.wrapping v1 v2)) - (let (v22 u32) (bitcast v0)) - (let (v23 u32) (add.checked v22 12)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 7) (block 8))) + (br (block 3 v9 v1 v2 v0 v13))) (block 6 - (param v116 i32) - (param v117 i32) - (param v183 i32) - (param v188 i32) - (param v200 i32) - (param v216 i32) - (param v223 i32) - (let (v118 i1) (eq v116 v117)) - (let (v119 i32) (zext v118)) - (let (v120 i1) (neq v119 0)) - (condbr v120 (block 4 v216 v223 v200 v188) (block 21))) + (param v144 i32) + (param v153 i32) + (param v165 i32) + (param v166 i32) + (let (v152 i1) (neq v144 0)) + (condbr v152 (block 32) (block 33))) (block 7 - (let (v29 i32) (const.i32 0)) - (br (block 9 v1 v21 v29 v26 v2 v1 v8 v0))) + (let (v28 i32) (add.wrapping v26 v27)) + (let (v30 u32) (bitcast v29)) + (let (v31 u32) (add.checked v30 12)) + (let (v32 u32) (mod.unchecked v31 4)) + (assertz 250 v32) + (let (v33 (ptr i32)) (inttoptr v31)) + (let (v34 i32) (load v33)) + (let (v35 i1) (neq v34 0)) + (condbr v35 (block 9) (block 10))) (block 8 - (let (v28 i32) (const.i32 0)) - (br (block 6 v1 v21 v28 v2 v1 v8 v0))) + (param v83 i32) + (param v84 i32) + (param v102 i32) + (param v107 i32) + (param v116 i32) + (param v148 i32) + (param v156 i32) + (let (v85 i1) (eq v83 v84)) + (let (v86 i32) (zext v85)) + (let (v87 i1) (neq v86 0)) + (condbr v87 (block 6 v148 v156 v116 v107) (block 22))) (block 9 - (param v30 i32) - (param v31 i32) - (param v105 i32) - (param v111 i32) - (param v190 i32) - (param v202 i32) - (param v214 i32) - (param v221 i32) - (let (v32 i1) (eq v30 v31)) - (let (v33 i32) (zext v32)) - (let (v34 i1) (neq v33 0)) - (condbr v34 (block 4 v214 v221 v202 v190) (block 11))) + (let (v37 i32) (const.i32 0)) + (br (block 11 v26 v28 v37 v34 v27 v26 v145 v29))) (block 10 - (br (block 6 v108 v115 v109 v189 v201 v215 v222))) + (let (v36 i32) (const.i32 0)) + (br (block 8 v26 v28 v36 v27 v26 v145 v29))) (block 11 - (let (v35 u32) (bitcast v30)) - (let (v36 (ptr i8)) (inttoptr v35)) - (let (v37 i8) (load v36)) - (let (v38 i32) (sext v37)) - (let (v39 i32) (const.i32 -1)) - (let (v40 i1) (lte v38 v39)) - (let (v41 i32) (sext v40)) + (param v38 i32) + (param v39 i32) + (param v75 i32) + (param v78 i32) + (param v109 i32) + (param v118 i32) + (param v146 i32) + (param v154 i32) + (let (v40 i1) (eq v38 v39)) + (let (v41 i32) (zext v40)) (let (v42 i1) (neq v41 0)) - (condbr v42 (block 13) (block 14))) + (condbr v42 (block 6 v146 v154 v118 v109) (block 13))) (block 12 - (param v104 i32) - (param v106 i32) - (param v108 i32) - (param v110 i32) - (param v115 i32) - (param v189 i32) - (param v201 i32) - (param v215 i32) - (param v222 i32) - (let (v107 i32) (sub.wrapping v104 v106)) - (let (v109 i32) (add.wrapping v107 v108)) - (let (v112 i32) (const.i32 -1)) - (let (v113 i32) (add.wrapping v110 v112)) - (let (v114 i1) (neq v113 0)) - (condbr v114 (block 9 v108 v115 v109 v113 v189 v201 v215 v222) (block 20))) + (br (block 8 v71 v82 v76 v108 v117 v147 v155))) (block 13 - (let (v45 i32) (const.i32 -32)) - (let (v46 u32) (bitcast v38)) - (let (v47 u32) (bitcast v45)) - (let (v48 i1) (gte v46 v47)) - (let (v49 i32) (zext v48)) + (let (v43 u32) (bitcast v38)) + (let (v44 (ptr i8)) (inttoptr v43)) + (let (v45 i8) (load v44)) + (let (v46 i32) (sext v45)) + (let (v47 i32) (const.i32 -1)) + (let (v48 i1) (lte v46 v47)) + (let (v49 i32) (sext v48)) (let (v50 i1) (neq v49 0)) (condbr v50 (block 15) (block 16))) (block 14 - (let (v43 i32) (const.i32 1)) - (let (v44 i32) (add.wrapping v30 v43)) - (br (block 12 v105 v30 v44 v111 v31 v190 v202 v214 v221))) + (param v71 i32) + (param v72 i32) + (param v74 i32) + (param v77 i32) + (param v82 i32) + (param v108 i32) + (param v117 i32) + (param v147 i32) + (param v155 i32) + (let (v73 i32) (sub.wrapping v71 v72)) + (let (v76 i32) (add.wrapping v73 v74)) + (let (v79 i32) (const.i32 -1)) + (let (v80 i32) (add.wrapping v77 v79)) + (let (v81 i1) (neq v80 0)) + (condbr v81 (block 11 v71 v82 v76 v80 v108 v117 v147 v155) (block 21))) (block 15 - (let (v53 i32) (const.i32 -16)) - (let (v54 u32) (bitcast v38)) + (let (v53 i32) (const.i32 -32)) + (let (v54 u32) (bitcast v46)) (let (v55 u32) (bitcast v53)) (let (v56 i1) (gte v54 v55)) (let (v57 i32) (zext v56)) @@ -1783,562 +1837,494 @@ (condbr v58 (block 17) (block 18))) (block 16 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (add.wrapping v30 v51)) - (br (block 12 v105 v30 v52 v111 v31 v190 v202 v214 v221))) + (let (v51 i32) (const.i32 1)) + (let (v52 i32) (add.wrapping v38 v51)) + (br (block 14 v52 v38 v75 v78 v39 v109 v118 v146 v154))) (block 17 - (let (v61 u32) (bitcast v30)) - (let (v62 u32) (add.checked v61 2)) - (let (v63 (ptr u8)) (inttoptr v62)) - (let (v64 u8) (load v63)) + (let (v61 i32) (const.i32 -16)) + (let (v62 u32) (bitcast v46)) + (let (v63 u32) (bitcast v61)) + (let (v64 i1) (gte v62 v63)) (let (v65 i32) (zext v64)) - (let (v66 i32) (const.i32 63)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (const.i32 6)) - (let (v69 u32) (bitcast v68)) - (let (v70 i32) (shl.wrapping v67 v69)) - (let (v71 u32) (bitcast v30)) - (let (v72 u32) (add.checked v71 1)) - (let (v73 (ptr u8)) (inttoptr v72)) - (let (v74 u8) (load v73)) - (let (v75 i32) (zext v74)) - (let (v76 i32) (const.i32 63)) - (let (v77 i32) (band v75 v76)) - (let (v78 i32) (const.i32 12)) - (let (v79 u32) (bitcast v78)) - (let (v80 i32) (shl.wrapping v77 v79)) - (let (v81 i32) (bor v70 v80)) - (let (v82 u32) (bitcast v30)) - (let (v83 u32) (add.checked v82 3)) - (let (v84 (ptr u8)) (inttoptr v83)) - (let (v85 u8) (load v84)) - (let (v86 i32) (zext v85)) - (let (v87 i32) (const.i32 63)) - (let (v88 i32) (band v86 v87)) - (let (v89 i32) (bor v81 v88)) - (let (v90 i32) (const.i32 255)) - (let (v91 i32) (band v38 v90)) - (let (v92 i32) (const.i32 18)) - (let (v93 u32) (bitcast v92)) - (let (v94 i32) (shl.wrapping v91 v93)) - (let (v95 i32) (const.i32 1835008)) - (let (v96 i32) (band v94 v95)) - (let (v97 i32) (bor v89 v96)) - (let (v98 i32) (const.i32 1114112)) - (let (v99 i1) (eq v97 v98)) - (let (v100 i32) (zext v99)) - (let (v101 i1) (neq v100 0)) - (condbr v101 (block 4 v214 v221 v202 v190) (block 19))) + (let (v66 i1) (neq v65 0)) + (condbr v66 (block 19) (block 20))) (block 18 - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (add.wrapping v30 v59)) - (br (block 12 v105 v30 v60 v111 v31 v190 v202 v214 v221))) + (let (v59 i32) (const.i32 2)) + (let (v60 i32) (add.wrapping v38 v59)) + (br (block 14 v60 v38 v75 v78 v39 v109 v118 v146 v154))) (block 19 - (let (v102 i32) (const.i32 4)) - (let (v103 i32) (add.wrapping v30 v102)) - (br (block 12 v105 v30 v103 v111 v31 v190 v202 v214 v221))) + (let (v69 i32) (const.i32 4)) + (let (v70 i32) (add.wrapping v38 v69)) + (br (block 14 v70 v38 v75 v78 v39 v109 v118 v146 v154))) (block 20 - (br (block 10))) + (let (v67 i32) (const.i32 3)) + (let (v68 i32) (add.wrapping v38 v67)) + (br (block 14 v68 v38 v75 v78 v39 v109 v118 v146 v154))) (block 21 - (let (v121 u32) (bitcast v116)) - (let (v122 (ptr i8)) (inttoptr v121)) - (let (v123 i8) (load v122)) - (let (v124 i32) (sext v123)) - (let (v125 i32) (const.i32 -1)) - (let (v126 i1) (gt v124 v125)) - (let (v127 i32) (zext v126)) - (let (v128 i1) (neq v127 0)) - (condbr v128 (block 22 v183 v188 v200 v216 v223) (block 23))) + (br (block 12))) (block 22 - (param v182 i32) - (param v187 i32) - (param v199 i32) - (param v217 i32) - (param v224 i32) - (let (v184 i1) (eq v182 0)) - (let (v185 i32) (zext v184)) - (let (v186 i1) (neq v185 0)) - (condbr v186 (block 27 v182 v217 v224 v199) (block 28))) + (let (v88 u32) (bitcast v83)) + (let (v89 (ptr i8)) (inttoptr v88)) + (let (v90 i8) (load v89)) + (let (v91 i32) (sext v90)) + (let (v92 i32) (const.i32 -1)) + (let (v93 i1) (gt v91 v92)) + (let (v94 i32) (zext v93)) + (let (v95 i1) (neq v94 0)) + (condbr v95 (block 23 v102 v107 v116 v148 v156) (block 24))) (block 23 - (let (v129 i32) (const.i32 -32)) - (let (v130 u32) (bitcast v124)) - (let (v131 u32) (bitcast v129)) - (let (v132 i1) (lt v130 v131)) - (let (v133 i32) (sext v132)) - (let (v134 i1) (neq v133 0)) - (condbr v134 (block 22 v183 v188 v200 v216 v223) (block 24))) + (param v101 i32) + (param v106 i32) + (param v115 i32) + (param v150 i32) + (param v158 i32) + (let (v103 i1) (eq v101 0)) + (let (v104 i32) (zext v103)) + (let (v105 i1) (neq v104 0)) + (condbr v105 (block 26 v115 v101 v106 v150 v158) (block 27))) (block 24 - (let (v135 i32) (const.i32 -16)) - (let (v136 u32) (bitcast v124)) - (let (v137 u32) (bitcast v135)) - (let (v138 i1) (lt v136 v137)) - (let (v139 i32) (sext v138)) - (let (v140 i1) (neq v139 0)) - (condbr v140 (block 22 v183 v188 v200 v216 v223) (block 25))) + (let (v96 i32) (const.i32 -32)) + (let (v97 u32) (bitcast v91)) + (let (v98 u32) (bitcast v96)) + (let (v99 i1) (lt v97 v98)) + (let (v100 i32) (sext v99)) + (br (block 23 v102 v107 v116 v148 v156))) (block 25 - (let (v141 u32) (bitcast v116)) - (let (v142 u32) (add.checked v141 2)) - (let (v143 (ptr u8)) (inttoptr v142)) - (let (v144 u8) (load v143)) - (let (v145 i32) (zext v144)) - (let (v146 i32) (const.i32 63)) - (let (v147 i32) (band v145 v146)) - (let (v148 i32) (const.i32 6)) - (let (v149 u32) (bitcast v148)) - (let (v150 i32) (shl.wrapping v147 v149)) - (let (v151 u32) (bitcast v116)) - (let (v152 u32) (add.checked v151 1)) - (let (v153 (ptr u8)) (inttoptr v152)) - (let (v154 u8) (load v153)) - (let (v155 i32) (zext v154)) - (let (v156 i32) (const.i32 63)) - (let (v157 i32) (band v155 v156)) - (let (v158 i32) (const.i32 12)) - (let (v159 u32) (bitcast v158)) - (let (v160 i32) (shl.wrapping v157 v159)) - (let (v161 i32) (bor v150 v160)) - (let (v162 u32) (bitcast v116)) - (let (v163 u32) (add.checked v162 3)) - (let (v164 (ptr u8)) (inttoptr v163)) - (let (v165 u8) (load v164)) - (let (v166 i32) (zext v165)) - (let (v167 i32) (const.i32 63)) - (let (v168 i32) (band v166 v167)) - (let (v169 i32) (bor v161 v168)) - (let (v170 i32) (const.i32 255)) - (let (v171 i32) (band v124 v170)) - (let (v172 i32) (const.i32 18)) - (let (v173 u32) (bitcast v172)) - (let (v174 i32) (shl.wrapping v171 v173)) - (let (v175 i32) (const.i32 1835008)) - (let (v176 i32) (band v174 v175)) - (let (v177 i32) (bor v169 v176)) - (let (v178 i32) (const.i32 1114112)) - (let (v179 i1) (eq v177 v178)) - (let (v180 i32) (zext v179)) - (let (v181 i1) (neq v180 0)) - (condbr v181 (block 4 v216 v223 v200 v188) (block 26))) + (param v134 i32) + (param v136 i32) + (param v138 i32) + (param v141 i32) + (param v149 i32) + (param v157 i32) + (let (v139 i1) (neq v138 0)) + (let (v140 i32) (select v139 v134 v136)) + (let (v142 i1) (neq v138 0)) + (let (v143 i32) (select v142 v138 v141)) + (br (block 6 v149 v157 v143 v140))) (block 26 - (br (block 22 v183 v188 v200 v216 v223))) + (param v133 i32) + (param v135 i32) + (param v137 i32) + (param v151 i32) + (param v159 i32) + (br (block 25 v135 v137 v133 v133 v151 v159))) (block 27 - (param v212 i32) - (param v218 i32) - (param v225 i32) - (param v232 i32) - (br (block 4 v218 v225 v232 v212))) + (let (v110 u32) (bitcast v101)) + (let (v111 u32) (bitcast v106)) + (let (v112 i1) (gte v110 v111)) + (let (v113 i32) (zext v112)) + (let (v114 i1) (neq v113 0)) + (condbr v114 (block 28) (block 29))) (block 28 - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v187)) - (let (v193 i1) (lt v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 29) (block 30))) + (let (v129 i1) (eq v101 v106)) + (let (v130 i32) (zext v129)) + (let (v131 i1) (neq v130 0)) + (condbr v131 (block 26 v115 v101 v106 v150 v158) (block 31))) (block 29 - (let (v203 i32) (add.wrapping v199 v182)) - (let (v204 u32) (bitcast v203)) - (let (v205 (ptr i8)) (inttoptr v204)) - (let (v206 i8) (load v205)) - (let (v207 i32) (sext v206)) - (let (v208 i32) (const.i32 -64)) - (let (v209 i1) (lt v207 v208)) - (let (v210 i32) (sext v209)) - (let (v211 i1) (neq v210 0)) - (condbr v211 (block 4 v217 v224 v199 v187) (block 32))) + (let (v119 i32) (add.wrapping v115 v101)) + (let (v120 u32) (bitcast v119)) + (let (v121 (ptr i8)) (inttoptr v120)) + (let (v122 i8) (load v121)) + (let (v123 i32) (sext v122)) + (let (v124 i32) (const.i32 -65)) + (let (v125 i1) (gt v123 v124)) + (let (v126 i32) (zext v125)) + (let (v127 i1) (neq v126 0)) + (condbr v127 (block 26 v115 v101 v106 v150 v158) (block 30))) (block 30 - (let (v196 i1) (eq v182 v187)) - (let (v197 i32) (zext v196)) - (let (v198 i1) (neq v197 0)) - (condbr v198 (block 27 v182 v217 v224 v199) (block 31))) + (let (v128 i32) (const.i32 0)) + (br (block 25 v101 v106 v128 v115 v150 v158))) (block 31 - (br (block 4 v217 v224 v199 v187))) + (let (v132 i32) (const.i32 0)) + (br (block 25 v101 v106 v132 v115 v150 v158))) (block 32 - (br (block 27 v182 v217 v224 v199))) + (let (v177 u32) (bitcast v153)) + (let (v178 u32) (add.checked v177 4)) + (let (v179 u32) (mod.unchecked v178 4)) + (assertz 250 v179) + (let (v180 (ptr i32)) (inttoptr v178)) + (let (v181 i32) (load v180)) + (let (v182 i32) (const.i32 16)) + (let (v183 u32) (bitcast v166)) + (let (v184 u32) (bitcast v182)) + (let (v185 i1) (lt v183 v184)) + (let (v186 i32) (sext v185)) + (let (v187 i1) (neq v186 0)) + (condbr v187 (block 35) (block 36))) (block 33 - (let (v244 u32) (bitcast v220)) - (let (v245 u32) (add.checked v244 4)) - (let (v246 u32) (mod.unchecked v245 4)) - (assertz 250 v246) - (let (v247 (ptr i32)) (inttoptr v245)) - (let (v248 i32) (load v247)) - (let (v249 i32) (const.i32 16)) - (let (v250 u32) (bitcast v233)) - (let (v251 u32) (bitcast v249)) - (let (v252 i1) (lt v250 v251)) - (let (v253 i32) (sext v252)) - (let (v254 i1) (neq v253 0)) - (condbr v254 (block 36) (block 37))) + (let (v160 u32) (bitcast v153)) + (let (v161 u32) (add.checked v160 20)) + (let (v162 u32) (mod.unchecked v161 4)) + (assertz 250 v162) + (let (v163 (ptr i32)) (inttoptr v161)) + (let (v164 i32) (load v163)) + (let (v167 u32) (bitcast v153)) + (let (v168 u32) (add.checked v167 24)) + (let (v169 u32) (mod.unchecked v168 4)) + (assertz 250 v169) + (let (v170 (ptr i32)) (inttoptr v168)) + (let (v171 i32) (load v170)) + (let (v172 u32) (bitcast v171)) + (let (v173 u32) (add.checked v172 12)) + (let (v174 u32) (mod.unchecked v173 4)) + (assertz 250 v174) + (let (v175 (ptr i32)) (inttoptr v173)) + (let (v176 i32) (load v175)) + (ret v176)) (block 34 - (let (v226 u32) (bitcast v220)) - (let (v227 u32) (add.checked v226 20)) - (let (v228 u32) (mod.unchecked v227 4)) - (assertz 250 v228) - (let (v229 (ptr i32)) (inttoptr v227)) - (let (v230 i32) (load v229)) - (let (v234 u32) (bitcast v220)) - (let (v235 u32) (add.checked v234 24)) - (let (v236 u32) (mod.unchecked v235 4)) - (assertz 250 v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 u32) (bitcast v238)) - (let (v240 u32) (add.checked v239 12)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (ret v243)) + (param v278 i32) + (param v282 i32) + (param v290 i32) + (param v355 i32) + (param v357 i32) + (let (v283 u32) (bitcast v278)) + (let (v284 u32) (bitcast v282)) + (let (v285 i1) (lte v283 v284)) + (let (v286 i32) (sext v285)) + (let (v287 i1) (neq v286 0)) + (condbr v287 (block 50) (block 51))) (block 35 - (param v345 i32) - (param v349 i32) - (param v357 i32) - (param v422 i32) - (param v424 i32) - (let (v350 u32) (bitcast v345)) - (let (v351 u32) (bitcast v349)) - (let (v352 i1) (lte v350 v351)) - (let (v353 i32) (sext v352)) - (let (v354 i1) (neq v353 0)) - (condbr v354 (block 51) (block 52))) + (let (v189 i1) (neq v166 0)) + (condbr v189 (block 37) (block 38))) (block 36 - (let (v256 i1) (neq v233 0)) - (condbr v256 (block 38) (block 39))) + (let (v188 i32) (call #core::str::count::do_count_chars v165 v166)) + (br (block 34 v181 v188 v153 v165 v166))) (block 37 - (let (v255 i32) (call #core::str::count::do_count_chars v231 v233)) - (br (block 35 v248 v255 v220 v231 v233))) + (let (v191 i32) (const.i32 3)) + (let (v192 i32) (band v166 v191)) + (let (v193 i32) (const.i32 4)) + (let (v194 u32) (bitcast v166)) + (let (v195 u32) (bitcast v193)) + (let (v196 i1) (gte v194 v195)) + (let (v197 i32) (zext v196)) + (let (v198 i1) (neq v197 0)) + (condbr v198 (block 40) (block 41))) (block 38 - (let (v258 i32) (const.i32 3)) - (let (v259 i32) (band v233 v258)) - (let (v260 i32) (const.i32 4)) - (let (v261 u32) (bitcast v233)) - (let (v262 u32) (bitcast v260)) - (let (v263 i1) (gte v261 v262)) - (let (v264 i32) (zext v263)) - (let (v265 i1) (neq v264 0)) - (condbr v265 (block 41) (block 42))) + (let (v190 i32) (const.i32 0)) + (br (block 34 v181 v190 v153 v165 v166))) (block 39 - (let (v257 i32) (const.i32 0)) - (br (block 35 v248 v257 v220 v231 v233))) + (param v253 i32) + (param v258 i32) + (param v259 i32) + (param v277 i32) + (param v279 i32) + (param v291 i32) + (param v358 i32) + (let (v255 i1) (eq v253 0)) + (let (v256 i32) (zext v255)) + (let (v257 i1) (neq v256 0)) + (condbr v257 (block 34 v279 v277 v291 v258 v358) (block 45))) (block 40 - (param v320 i32) - (param v325 i32) - (param v326 i32) - (param v344 i32) - (param v346 i32) - (param v358 i32) - (param v425 i32) - (let (v322 i1) (eq v320 0)) - (let (v323 i32) (zext v322)) - (let (v324 i1) (neq v323 0)) - (condbr v324 (block 35 v346 v344 v358 v325 v425) (block 46))) + (let (v201 i32) (const.i32 12)) + (let (v202 i32) (band v166 v201)) + (let (v203 i32) (const.i32 0)) + (let (v204 i32) (const.i32 0)) + (br (block 42 v203 v165 v204 v202 v192 v181 v153 v166))) (block 41 - (let (v268 i32) (const.i32 12)) - (let (v269 i32) (band v233 v268)) - (let (v270 i32) (const.i32 0)) - (let (v271 i32) (const.i32 0)) - (br (block 43 v270 v231 v271 v269 v259 v248 v220 v233))) + (let (v199 i32) (const.i32 0)) + (let (v200 i32) (const.i32 0)) + (br (block 39 v192 v165 v200 v199 v181 v153 v166))) (block 42 - (let (v266 i32) (const.i32 0)) - (let (v267 i32) (const.i32 0)) - (br (block 40 v259 v231 v267 v266 v248 v220 v233))) + (param v205 i32) + (param v206 i32) + (param v207 i32) + (param v247 i32) + (param v254 i32) + (param v280 i32) + (param v292 i32) + (param v359 i32) + (let (v208 i32) (add.wrapping v206 v207)) + (let (v209 u32) (bitcast v208)) + (let (v210 (ptr i8)) (inttoptr v209)) + (let (v211 i8) (load v210)) + (let (v212 i32) (sext v211)) + (let (v213 i32) (const.i32 -65)) + (let (v214 i1) (gt v212 v213)) + (let (v215 i32) (zext v214)) + (let (v216 i32) (add.wrapping v205 v215)) + (let (v217 i32) (const.i32 1)) + (let (v218 i32) (add.wrapping v208 v217)) + (let (v219 u32) (bitcast v218)) + (let (v220 (ptr i8)) (inttoptr v219)) + (let (v221 i8) (load v220)) + (let (v222 i32) (sext v221)) + (let (v223 i32) (const.i32 -65)) + (let (v224 i1) (gt v222 v223)) + (let (v225 i32) (zext v224)) + (let (v226 i32) (add.wrapping v216 v225)) + (let (v227 i32) (const.i32 2)) + (let (v228 i32) (add.wrapping v208 v227)) + (let (v229 u32) (bitcast v228)) + (let (v230 (ptr i8)) (inttoptr v229)) + (let (v231 i8) (load v230)) + (let (v232 i32) (sext v231)) + (let (v233 i32) (const.i32 -65)) + (let (v234 i1) (gt v232 v233)) + (let (v235 i32) (zext v234)) + (let (v236 i32) (add.wrapping v226 v235)) + (let (v237 i32) (const.i32 3)) + (let (v238 i32) (add.wrapping v208 v237)) + (let (v239 u32) (bitcast v238)) + (let (v240 (ptr i8)) (inttoptr v239)) + (let (v241 i8) (load v240)) + (let (v242 i32) (sext v241)) + (let (v243 i32) (const.i32 -65)) + (let (v244 i1) (gt v242 v243)) + (let (v245 i32) (zext v244)) + (let (v246 i32) (add.wrapping v236 v245)) + (let (v248 i32) (const.i32 4)) + (let (v249 i32) (add.wrapping v207 v248)) + (let (v250 i1) (neq v247 v249)) + (let (v251 i32) (zext v250)) + (let (v252 i1) (neq v251 0)) + (condbr v252 (block 42 v246 v206 v249 v247 v254 v280 v292 v359) (block 44))) (block 43 - (param v272 i32) - (param v273 i32) - (param v274 i32) - (param v314 i32) - (param v321 i32) - (param v347 i32) - (param v359 i32) - (param v426 i32) - (let (v275 i32) (add.wrapping v273 v274)) - (let (v276 u32) (bitcast v275)) - (let (v277 (ptr i8)) (inttoptr v276)) - (let (v278 i8) (load v277)) - (let (v279 i32) (sext v278)) - (let (v280 i32) (const.i32 -65)) - (let (v281 i1) (gt v279 v280)) - (let (v282 i32) (zext v281)) - (let (v283 i32) (add.wrapping v272 v282)) - (let (v284 i32) (const.i32 1)) - (let (v285 i32) (add.wrapping v275 v284)) - (let (v286 u32) (bitcast v285)) - (let (v287 (ptr i8)) (inttoptr v286)) - (let (v288 i8) (load v287)) - (let (v289 i32) (sext v288)) - (let (v290 i32) (const.i32 -65)) - (let (v291 i1) (gt v289 v290)) - (let (v292 i32) (zext v291)) - (let (v293 i32) (add.wrapping v283 v292)) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (add.wrapping v275 v294)) - (let (v296 u32) (bitcast v295)) - (let (v297 (ptr i8)) (inttoptr v296)) - (let (v298 i8) (load v297)) - (let (v299 i32) (sext v298)) - (let (v300 i32) (const.i32 -65)) - (let (v301 i1) (gt v299 v300)) - (let (v302 i32) (zext v301)) - (let (v303 i32) (add.wrapping v293 v302)) - (let (v304 i32) (const.i32 3)) - (let (v305 i32) (add.wrapping v275 v304)) - (let (v306 u32) (bitcast v305)) - (let (v307 (ptr i8)) (inttoptr v306)) - (let (v308 i8) (load v307)) - (let (v309 i32) (sext v308)) - (let (v310 i32) (const.i32 -65)) - (let (v311 i1) (gt v309 v310)) - (let (v312 i32) (zext v311)) - (let (v313 i32) (add.wrapping v303 v312)) - (let (v315 i32) (const.i32 4)) - (let (v316 i32) (add.wrapping v274 v315)) - (let (v317 i1) (neq v314 v316)) - (let (v318 i32) (zext v317)) - (let (v319 i1) (neq v318 0)) - (condbr v319 (block 43 v313 v273 v316 v314 v321 v347 v359 v426) (block 45))) + (br (block 39 v254 v206 v249 v246 v280 v292 v359))) (block 44 - (br (block 40 v321 v273 v316 v313 v347 v359 v426))) + (br (block 43))) (block 45 - (br (block 44))) + (let (v260 i32) (add.wrapping v258 v259)) + (br (block 46 v277 v260 v253 v279 v291 v258 v358))) (block 46 - (let (v327 i32) (add.wrapping v325 v326)) - (br (block 47 v344 v327 v320 v346 v358 v325 v425))) + (param v261 i32) + (param v262 i32) + (param v273 i32) + (param v281 i32) + (param v293 i32) + (param v356 i32) + (param v360 i32) + (let (v263 u32) (bitcast v262)) + (let (v264 (ptr i8)) (inttoptr v263)) + (let (v265 i8) (load v264)) + (let (v266 i32) (sext v265)) + (let (v267 i32) (const.i32 -65)) + (let (v268 i1) (gt v266 v267)) + (let (v269 i32) (zext v268)) + (let (v270 i32) (add.wrapping v261 v269)) + (let (v271 i32) (const.i32 1)) + (let (v272 i32) (add.wrapping v262 v271)) + (let (v274 i32) (const.i32 -1)) + (let (v275 i32) (add.wrapping v273 v274)) + (let (v276 i1) (neq v275 0)) + (condbr v276 (block 46 v270 v272 v275 v281 v293 v356 v360) (block 48))) (block 47 - (param v328 i32) - (param v329 i32) - (param v340 i32) - (param v348 i32) - (param v360 i32) - (param v423 i32) - (param v427 i32) - (let (v330 u32) (bitcast v329)) - (let (v331 (ptr i8)) (inttoptr v330)) - (let (v332 i8) (load v331)) - (let (v333 i32) (sext v332)) - (let (v334 i32) (const.i32 -65)) - (let (v335 i1) (gt v333 v334)) - (let (v336 i32) (zext v335)) - (let (v337 i32) (add.wrapping v328 v336)) - (let (v338 i32) (const.i32 1)) - (let (v339 i32) (add.wrapping v329 v338)) - (let (v341 i32) (const.i32 -1)) - (let (v342 i32) (add.wrapping v340 v341)) - (let (v343 i1) (neq v342 0)) - (condbr v343 (block 47 v337 v339 v342 v348 v360 v423 v427) (block 49))) + (br (block 34 v281 v270 v293 v356 v360))) (block 48 - (br (block 35 v348 v337 v360 v423 v427))) + (br (block 47))) (block 49 - (br (block 48))) + (let (v375 u32) (bitcast v340)) + (let (v376 u32) (add.checked v375 12)) + (let (v377 u32) (mod.unchecked v376 4)) + (assertz 250 v377) + (let (v378 (ptr i32)) (inttoptr v376)) + (let (v379 i32) (load v378)) + (let (v380 i1) (eq v379 0)) + (let (v381 i32) (zext v380)) + (let (v382 i1) (neq v381 0)) + (condbr v382 (block 59) (block 60))) (block 50 - (let (v438 i32) (const.i32 1)) - (let (v443 u32) (bitcast v407)) - (let (v444 u32) (add.checked v443 12)) - (let (v445 u32) (mod.unchecked v444 4)) - (assertz 250 v445) - (let (v446 (ptr i32)) (inttoptr v444)) - (let (v447 i32) (load v446)) - (let (v448 i1) (neq v447 0)) - (condbr v448 (block 60 v438) (block 61))) + (let (v350 u32) (bitcast v290)) + (let (v351 u32) (add.checked v350 20)) + (let (v352 u32) (mod.unchecked v351 4)) + (assertz 250 v352) + (let (v353 (ptr i32)) (inttoptr v351)) + (let (v354 i32) (load v353)) + (let (v361 u32) (bitcast v290)) + (let (v362 u32) (add.checked v361 24)) + (let (v363 u32) (mod.unchecked v362 4)) + (assertz 250 v363) + (let (v364 (ptr i32)) (inttoptr v362)) + (let (v365 i32) (load v364)) + (let (v366 u32) (bitcast v365)) + (let (v367 u32) (add.checked v366 12)) + (let (v368 u32) (mod.unchecked v367 4)) + (assertz 250 v368) + (let (v369 (ptr i32)) (inttoptr v367)) + (let (v370 i32) (load v369)) + (ret v370)) (block 51 - (let (v417 u32) (bitcast v357)) - (let (v418 u32) (add.checked v417 20)) - (let (v419 u32) (mod.unchecked v418 4)) - (assertz 250 v419) - (let (v420 (ptr i32)) (inttoptr v418)) - (let (v421 i32) (load v420)) - (let (v428 u32) (bitcast v357)) - (let (v429 u32) (add.checked v428 24)) - (let (v430 u32) (mod.unchecked v429 4)) - (assertz 250 v430) - (let (v431 (ptr i32)) (inttoptr v429)) - (let (v432 i32) (load v431)) - (let (v433 u32) (bitcast v432)) - (let (v434 u32) (add.checked v433 12)) - (let (v435 u32) (mod.unchecked v434 4)) - (assertz 250 v435) - (let (v436 (ptr i32)) (inttoptr v434)) - (let (v437 i32) (load v436)) - (ret v437)) + (let (v288 i32) (sub.wrapping v278 v282)) + (let (v289 i32) (const.i32 0)) + (let (v294 u32) (bitcast v290)) + (let (v295 u32) (add.checked v294 32)) + (let (v296 (ptr u8)) (inttoptr v295)) + (let (v297 u8) (load v296)) + (let (v298 i32) (zext v297)) + (let (v299 u32) (cast v298)) + (switchv299 + (0 . (block 54)) + (1 . (block 53)) + (2 . (block 52 v289 v290 v355 v357 v288)) + (3 . (block 52 v289 v290 v355 v357 v288)) + (_ . (block 52 v289 v290 v355 v357 v288)))) (block 52 - (let (v355 i32) (sub.wrapping v345 v349)) - (let (v356 i32) (const.i32 0)) - (let (v361 u32) (bitcast v357)) - (let (v362 u32) (add.checked v361 32)) - (let (v363 (ptr u8)) (inttoptr v362)) - (let (v364 u8) (load v363)) - (let (v365 i32) (zext v364)) - (let (v366 u32) (cast v365)) - (switchv366 - (0 . (block 55)) - (1 . (block 54)) - (2 . (block 53 v356 v357 v422 v424 v355)) - (3 . (block 53 v356 v357 v422 v424 v355)) - (_ . (block 53 v356 v357 v422 v424 v355)))) + (param v313 i32) + (param v316 i32) + (param v372 i32) + (param v374 i32) + (param v408 i32) + (let (v314 i32) (const.i32 1)) + (let (v315 i32) (add.wrapping v313 v314)) + (let (v317 u32) (bitcast v316)) + (let (v318 u32) (add.checked v317 16)) + (let (v319 u32) (mod.unchecked v318 4)) + (assertz 250 v319) + (let (v320 (ptr i32)) (inttoptr v318)) + (let (v321 i32) (load v320)) + (let (v322 u32) (bitcast v316)) + (let (v323 u32) (add.checked v322 24)) + (let (v324 u32) (mod.unchecked v323 4)) + (assertz 250 v324) + (let (v325 (ptr i32)) (inttoptr v323)) + (let (v326 i32) (load v325)) + (let (v327 u32) (bitcast v316)) + (let (v328 u32) (add.checked v327 20)) + (let (v329 u32) (mod.unchecked v328 4)) + (assertz 250 v329) + (let (v330 (ptr i32)) (inttoptr v328)) + (let (v331 i32) (load v330)) + (br (block 55 v315 v331 v321 v326 v372 v374 v408))) (block 53 - (param v380 i32) - (param v383 i32) - (param v440 i32) - (param v442 i32) - (param v469 i32) - (let (v381 i32) (const.i32 1)) - (let (v382 i32) (add.wrapping v380 v381)) - (let (v384 u32) (bitcast v383)) - (let (v385 u32) (add.checked v384 16)) - (let (v386 u32) (mod.unchecked v385 4)) - (assertz 250 v386) - (let (v387 (ptr i32)) (inttoptr v385)) - (let (v388 i32) (load v387)) - (let (v389 u32) (bitcast v383)) - (let (v390 u32) (add.checked v389 24)) - (let (v391 u32) (mod.unchecked v390 4)) - (assertz 250 v391) - (let (v392 (ptr i32)) (inttoptr v390)) - (let (v393 i32) (load v392)) - (let (v394 u32) (bitcast v383)) - (let (v395 u32) (add.checked v394 20)) - (let (v396 u32) (mod.unchecked v395 4)) - (assertz 250 v396) - (let (v397 (ptr i32)) (inttoptr v395)) - (let (v398 i32) (load v397)) - (br (block 56 v382 v398 v388 v393 v440 v442 v469))) + (let (v301 i32) (const.i32 1)) + (let (v302 u32) (bitcast v288)) + (let (v303 u32) (bitcast v301)) + (let (v304 u32) (shr.wrapping v302 v303)) + (let (v305 i32) (bitcast v304)) + (let (v306 i32) (const.i32 1)) + (let (v307 i32) (add.wrapping v288 v306)) + (let (v308 i32) (const.i32 1)) + (let (v309 u32) (bitcast v307)) + (let (v310 u32) (bitcast v308)) + (let (v311 u32) (shr.wrapping v309 v310)) + (let (v312 i32) (bitcast v311)) + (br (block 52 v305 v290 v355 v357 v312))) (block 54 - (let (v368 i32) (const.i32 1)) - (let (v369 u32) (bitcast v355)) - (let (v370 u32) (bitcast v368)) - (let (v371 u32) (shr.wrapping v369 v370)) - (let (v372 i32) (bitcast v371)) - (let (v373 i32) (const.i32 1)) - (let (v374 i32) (add.wrapping v355 v373)) - (let (v375 i32) (const.i32 1)) - (let (v376 u32) (bitcast v374)) - (let (v377 u32) (bitcast v375)) - (let (v378 u32) (shr.wrapping v376 v377)) - (let (v379 i32) (bitcast v378)) - (br (block 53 v372 v357 v422 v424 v379))) + (let (v300 i32) (const.i32 0)) + (br (block 52 v288 v290 v355 v357 v300))) (block 55 - (let (v367 i32) (const.i32 0)) - (br (block 53 v355 v357 v422 v424 v367))) + (param v332 i32) + (param v338 i32) + (param v339 i32) + (param v340 i32) + (param v371 i32) + (param v373 i32) + (param v407 i32) + (let (v333 i32) (const.i32 -1)) + (let (v334 i32) (add.wrapping v332 v333)) + (let (v335 i1) (eq v334 0)) + (let (v336 i32) (zext v335)) + (let (v337 i1) (neq v336 0)) + (condbr v337 (block 49) (block 57))) (block 56 - (param v399 i32) - (param v405 i32) - (param v406 i32) - (param v407 i32) - (param v439 i32) - (param v441 i32) - (param v468 i32) - (let (v400 i32) (const.i32 -1)) - (let (v401 i32) (add.wrapping v399 v400)) - (let (v402 i1) (eq v401 0)) - (let (v403 i32) (zext v402)) - (let (v404 i1) (neq v403 0)) - (condbr v404 (block 50) (block 58))) + (let (v349 i32) (const.i32 1)) + (ret v349)) (block 57 - (let (v416 i32) (const.i32 1)) - (ret v416)) + (let (v341 u32) (bitcast v340)) + (let (v342 u32) (add.checked v341 16)) + (let (v343 u32) (mod.unchecked v342 4)) + (assertz 250 v343) + (let (v344 (ptr i32)) (inttoptr v342)) + (let (v345 i32) (load v344)) + (let (v346 i1) (eq v345 0)) + (let (v347 i32) (zext v346)) + (let (v348 i1) (neq v347 0)) + (condbr v348 (block 55 v334 v338 v339 v340 v371 v373 v407) (block 58))) (block 58 - (let (v408 u32) (bitcast v407)) - (let (v409 u32) (add.checked v408 16)) - (let (v410 u32) (mod.unchecked v409 4)) - (assertz 250 v410) - (let (v411 (ptr i32)) (inttoptr v409)) - (let (v412 i32) (load v411)) - (let (v413 i1) (eq v412 0)) - (let (v414 i32) (zext v413)) - (let (v415 i1) (neq v414 0)) - (condbr v415 (block 56 v401 v405 v406 v407 v439 v441 v468) (block 59))) + (br (block 56))) (block 59 - (br (block 57))) + (let (v384 i32) (const.i32 0)) + (br (block 61 v407 v384 v338 v339 v340))) - (block 60 (param v478 i32) - (ret v478)) + (block 60 + (let (v383 i32) (const.i32 1)) + (ret v383)) (block 61 - (let (v449 i32) (const.i32 0)) - (br (block 63 v468 v449 v405 v406 v407))) - - (block 62 (param v472 i32) (param v473 i32) - (let (v474 u32) (bitcast v472)) - (let (v475 u32) (bitcast v473)) - (let (v476 i1) (lt v474 v475)) - (let (v477 i32) (sext v476)) - (br (block 60 v477))) + (param v385 i32) + (param v386 i32) + (param v396 i32) + (param v397 i32) + (param v398 i32) + (let (v387 i1) (neq v385 v386)) + (let (v388 i32) (zext v387)) + (let (v389 i1) (neq v388 0)) + (condbr v389 (block 63) (block 64))) + + (block 62 + (let (v409 i32) (const.i32 -1)) + (let (v410 i32) (add.wrapping v395 v409)) + (let (v411 u32) (bitcast v410)) + (let (v412 u32) (bitcast v385)) + (let (v413 i1) (lt v411 v412)) + (let (v414 i32) (sext v413)) + (ret v414)) (block 63 - (param v450 i32) - (param v451 i32) - (param v457 i32) - (param v458 i32) - (param v459 i32) - (let (v452 i1) (neq v450 v451)) - (let (v453 i32) (zext v452)) - (let (v454 i1) (neq v453 0)) - (condbr v454 (block 65) (block 66))) + (let (v394 i32) (const.i32 1)) + (let (v395 i32) (add.wrapping v386 v394)) + (let (v399 u32) (bitcast v398)) + (let (v400 u32) (add.checked v399 16)) + (let (v401 u32) (mod.unchecked v400 4)) + (assertz 250 v401) + (let (v402 (ptr i32)) (inttoptr v400)) + (let (v403 i32) (load v402)) + (let (v404 i1) (eq v403 0)) + (let (v405 i32) (zext v404)) + (let (v406 i1) (neq v405 0)) + (condbr v406 (block 61 v385 v395 v396 v397 v398) (block 65))) (block 64 - (let (v470 i32) (const.i32 -1)) - (let (v471 i32) (add.wrapping v456 v470)) - (br (block 62 v471 v450))) + (let (v390 u32) (bitcast v385)) + (let (v391 u32) (bitcast v385)) + (let (v392 i1) (lt v390 v391)) + (let (v393 i32) (sext v392)) + (ret v393)) (block 65 - (let (v455 i32) (const.i32 1)) - (let (v456 i32) (add.wrapping v451 v455)) - (let (v460 u32) (bitcast v459)) - (let (v461 u32) (add.checked v460 16)) - (let (v462 u32) (mod.unchecked v461 4)) - (assertz 250 v462) - (let (v463 (ptr i32)) (inttoptr v461)) - (let (v464 i32) (load v463)) - (let (v465 i1) (eq v464 0)) - (let (v466 i32) (zext v465)) - (let (v467 i1) (neq v466 0)) - (condbr v467 (block 63 v450 v456 v457 v458 v459) (block 67))) - - (block 66 - (br (block 62 v450 v450))) - - (block 67 - (br (block 64))) + (br (block 62))) ) (func (export #core::fmt::num::imp::::fmt) @@ -2969,28 +2955,6 @@ (br (block 4 v398))) ) - (func (export #::type_id) - (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v2 i64) (const.i64 5799598635382251841)) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (add.checked v3 8)) - (let (v5 u32) (mod.unchecked v4 8)) - (assertz 250 v5) - (let (v6 (ptr i64)) (inttoptr v4)) - (store v6 v2) - (let (v7 i64) (const.i64 3885382061309546557)) - (let (v8 u32) (bitcast v0)) - (let (v9 u32) (mod.unchecked v8 8)) - (assertz 250 v9) - (let (v10 (ptr i64)) (inttoptr v8)) - (store v10 v7) - (br (block 1))) - - (block 1 - (ret)) - ) - (func (export #core::fmt::builders::DebugStruct::field) (param i32) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 @@ -3018,25 +2982,25 @@ (block 1 (param v5 i32) (ret v5)) - (block 2 (param v246 i32) (param v254 i32) (param v260 i32) - (let (v248 i32) (const.i32 1)) - (let (v249 u32) (bitcast v248)) - (let (v250 u8) (trunc v249)) - (let (v251 u32) (bitcast v246)) - (let (v252 u32) (add.checked v251 5)) - (let (v253 (ptr u8)) (inttoptr v252)) - (store v253 v250) - (let (v255 u32) (bitcast v254)) - (let (v256 u8) (trunc v255)) - (let (v257 u32) (bitcast v246)) - (let (v258 u32) (add.checked v257 4)) - (let (v259 (ptr u8)) (inttoptr v258)) - (store v259 v256) - (let (v261 i32) (const.i32 64)) - (let (v262 i32) (add.wrapping v260 v261)) - (let (v263 (ptr i32)) (global.symbol #__stack_pointer)) - (store v263 v262) - (br (block 1 v246))) + (block 2 (param v244 i32) (param v252 i32) (param v258 i32) + (let (v246 i32) (const.i32 1)) + (let (v247 u32) (bitcast v246)) + (let (v248 u8) (trunc v247)) + (let (v249 u32) (bitcast v244)) + (let (v250 u32) (add.checked v249 5)) + (let (v251 (ptr u8)) (inttoptr v250)) + (store v251 v248) + (let (v253 u32) (bitcast v252)) + (let (v254 u8) (trunc v253)) + (let (v255 u32) (bitcast v244)) + (let (v256 u32) (add.checked v255 4)) + (let (v257 (ptr u8)) (inttoptr v256)) + (store v257 v254) + (let (v259 i32) (const.i32 64)) + (let (v260 i32) (add.wrapping v258 v259)) + (let (v261 (ptr i32)) (global.symbol #__stack_pointer)) + (store v261 v260) + (br (block 1 v244))) (block 3 (let (v19 u32) (bitcast v0)) @@ -3061,10 +3025,11 @@ (condbr v35 (block 4) (block 5))) (block 4 - (let (v104 i32) (const.i32 255)) - (let (v105 i32) (band v23 v104)) - (let (v106 i1) (neq v105 0)) - (condbr v106 (block 9 v10 v27 v32 v1 v2 v3 v4 v0) (block 10))) + (let (v102 i32) (const.i32 1)) + (let (v103 i32) (const.i32 1)) + (let (v104 i32) (band v23 v103)) + (let (v105 i1) (neq v104 0)) + (condbr v105 (block 9 v10 v27 v32 v1 v2 v3 v4 v0) (block 10))) (block 5 (let (v36 i32) (const.i32 1)) @@ -3074,9 +3039,9 @@ (assertz 250 v39) (let (v40 (ptr i32)) (inttoptr v38)) (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 1048959)) - (let (v43 i32) (const.i32 1048956)) - (let (v44 i32) (const.i32 255)) + (let (v42 i32) (const.i32 1048963)) + (let (v43 i32) (const.i32 1048960)) + (let (v44 i32) (const.i32 1)) (let (v45 i32) (band v23 v44)) (let (v46 i1) (neq v45 0)) (let (v47 i32) (select v46 v42 v43)) @@ -3100,249 +3065,246 @@ (condbr v62 (block 2 v0 v36 v10) (block 6))) (block 6 - (let (v63 i32) (const.i32 1)) - (let (v64 u32) (bitcast v27)) - (let (v65 u32) (add.checked v64 20)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v27)) - (let (v70 u32) (add.checked v69 24)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 u32) (bitcast v73)) - (let (v75 u32) (add.checked v74 12)) - (let (v76 u32) (mod.unchecked v75 4)) - (assertz 250 v76) - (let (v77 (ptr i32)) (inttoptr v75)) - (let (v78 i32) (load v77)) - (let (v79 i1) (neq v78 0)) - (condbr v79 (block 2 v0 v63 v10) (block 7))) + (let (v63 u32) (bitcast v27)) + (let (v64 u32) (add.checked v63 20)) + (let (v65 u32) (mod.unchecked v64 4)) + (assertz 250 v65) + (let (v66 (ptr i32)) (inttoptr v64)) + (let (v67 i32) (load v66)) + (let (v68 u32) (bitcast v27)) + (let (v69 u32) (add.checked v68 24)) + (let (v70 u32) (mod.unchecked v69 4)) + (assertz 250 v70) + (let (v71 (ptr i32)) (inttoptr v69)) + (let (v72 i32) (load v71)) + (let (v73 u32) (bitcast v72)) + (let (v74 u32) (add.checked v73 12)) + (let (v75 u32) (mod.unchecked v74 4)) + (assertz 250 v75) + (let (v76 (ptr i32)) (inttoptr v74)) + (let (v77 i32) (load v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 2 v0 v36 v10) (block 7))) (block 7 - (let (v80 i32) (const.i32 1)) - (let (v81 u32) (bitcast v27)) - (let (v82 u32) (add.checked v81 20)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 1048924)) - (let (v87 i32) (const.i32 2)) - (let (v88 u32) (bitcast v27)) - (let (v89 u32) (add.checked v88 24)) - (let (v90 u32) (mod.unchecked v89 4)) - (assertz 250 v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (let (v93 u32) (bitcast v92)) - (let (v94 u32) (add.checked v93 12)) - (let (v95 u32) (mod.unchecked v94 4)) - (assertz 250 v95) - (let (v96 (ptr i32)) (inttoptr v94)) - (let (v97 i32) (load v96)) - (let (v98 i1) (neq v97 0)) - (condbr v98 (block 2 v0 v80 v10) (block 8))) - - (block 8 - (let (v99 u32) (bitcast v4)) - (let (v100 u32) (add.checked v99 12)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 2 v0 v103 v10))) + (let (v79 u32) (bitcast v27)) + (let (v80 u32) (add.checked v79 20)) + (let (v81 u32) (mod.unchecked v80 4)) + (assertz 250 v81) + (let (v82 (ptr i32)) (inttoptr v80)) + (let (v83 i32) (load v82)) + (let (v84 i32) (const.i32 1048928)) + (let (v85 i32) (const.i32 2)) + (let (v86 u32) (bitcast v27)) + (let (v87 u32) (add.checked v86 24)) + (let (v88 u32) (mod.unchecked v87 4)) + (assertz 250 v88) + (let (v89 (ptr i32)) (inttoptr v87)) + (let (v90 i32) (load v89)) + (let (v91 u32) (bitcast v90)) + (let (v92 u32) (add.checked v91 12)) + (let (v93 u32) (mod.unchecked v92 4)) + (assertz 250 v93) + (let (v94 (ptr i32)) (inttoptr v92)) + (let (v95 i32) (load v94)) + (let (v96 i1) (neq v95 0)) + (condbr v96 (block 2 v0 v36 v10) (block 8))) - (block 9 - (param v132 i32) - (param v139 i32) - (param v173 i32) - (param v209 i32) - (param v210 i32) - (param v219 i32) - (param v222 i32) - (param v247 i32) + (block 8 + (let (v97 u32) (bitcast v4)) + (let (v98 u32) (add.checked v97 12)) + (let (v99 u32) (mod.unchecked v98 4)) + (assertz 250 v99) + (let (v100 (ptr i32)) (inttoptr v98)) + (let (v101 i32) (load v100)) + (br (block 2 v0 v101 v10))) + + (block 9 + (param v130 i32) + (param v137 i32) + (param v171 i32) + (param v207 i32) + (param v208 i32) + (param v217 i32) + (param v220 i32) + (param v245 i32) + (let (v129 i32) (const.i32 1)) (let (v131 i32) (const.i32 1)) - (let (v133 i32) (const.i32 1)) - (let (v134 u32) (bitcast v133)) - (let (v135 u8) (trunc v134)) - (let (v136 u32) (bitcast v132)) - (let (v137 u32) (add.checked v136 27)) - (let (v138 (ptr u8)) (inttoptr v137)) - (store v138 v135) - (let (v140 u32) (bitcast v139)) - (let (v141 u32) (add.checked v140 20)) - (let (v142 u32) (mod.unchecked v141 4)) - (assertz 250 v142) - (let (v143 (ptr i64)) (inttoptr v141)) - (let (v144 i64) (load v143)) - (let (v145 u32) (bitcast v132)) - (let (v146 u32) (add.checked v145 12)) - (let (v147 u32) (mod.unchecked v146 4)) - (assertz 250 v147) - (let (v148 (ptr i64)) (inttoptr v146)) - (store v148 v144) - (let (v149 i32) (const.i32 1048928)) - (let (v150 u32) (bitcast v132)) - (let (v151 u32) (add.checked v150 52)) - (let (v152 u32) (mod.unchecked v151 4)) - (assertz 250 v152) - (let (v153 (ptr i32)) (inttoptr v151)) - (store v153 v149) - (let (v154 i32) (const.i32 27)) - (let (v155 i32) (add.wrapping v132 v154)) - (let (v156 u32) (bitcast v132)) - (let (v157 u32) (add.checked v156 20)) - (let (v158 u32) (mod.unchecked v157 4)) - (assertz 250 v158) - (let (v159 (ptr i32)) (inttoptr v157)) - (store v159 v155) - (let (v160 u32) (bitcast v139)) - (let (v161 u32) (add.checked v160 8)) - (let (v162 u32) (mod.unchecked v161 4)) - (assertz 250 v162) - (let (v163 (ptr i64)) (inttoptr v161)) - (let (v164 i64) (load v163)) - (let (v165 u32) (bitcast v132)) - (let (v166 u32) (add.checked v165 36)) - (let (v167 u32) (mod.unchecked v166 4)) - (assertz 250 v167) - (let (v168 (ptr i64)) (inttoptr v166)) - (store v168 v164) - (let (v169 u32) (bitcast v139)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i64)) (inttoptr v169)) - (let (v172 i64) (load v171)) - (let (v174 u32) (bitcast v132)) - (let (v175 u32) (add.checked v174 56)) - (let (v176 u32) (mod.unchecked v175 4)) - (assertz 250 v176) - (let (v177 (ptr i32)) (inttoptr v175)) - (store v177 v173) - (let (v178 u32) (bitcast v139)) - (let (v179 u32) (add.checked v178 16)) - (let (v180 u32) (mod.unchecked v179 4)) - (assertz 250 v180) - (let (v181 (ptr i32)) (inttoptr v179)) - (let (v182 i32) (load v181)) - (let (v183 u32) (bitcast v132)) - (let (v184 u32) (add.checked v183 44)) - (let (v185 u32) (mod.unchecked v184 4)) - (assertz 250 v185) - (let (v186 (ptr i32)) (inttoptr v184)) - (store v186 v182) - (let (v187 u32) (bitcast v139)) - (let (v188 u32) (add.checked v187 32)) - (let (v189 (ptr u8)) (inttoptr v188)) - (let (v190 u8) (load v189)) - (let (v191 i32) (zext v190)) - (let (v192 u32) (bitcast v191)) - (let (v193 u8) (trunc v192)) - (let (v194 u32) (bitcast v132)) - (let (v195 u32) (add.checked v194 60)) - (let (v196 (ptr u8)) (inttoptr v195)) - (store v196 v193) - (let (v197 u32) (bitcast v132)) - (let (v198 u32) (add.checked v197 28)) - (let (v199 u32) (mod.unchecked v198 4)) - (assertz 250 v199) - (let (v200 (ptr i64)) (inttoptr v198)) - (store v200 v172) - (let (v201 i32) (const.i32 12)) - (let (v202 i32) (add.wrapping v132 v201)) - (let (v203 u32) (bitcast v132)) - (let (v204 u32) (add.checked v203 48)) - (let (v205 u32) (mod.unchecked v204 4)) - (assertz 250 v205) - (let (v206 (ptr i32)) (inttoptr v204)) - (store v206 v202) - (let (v207 i32) (const.i32 12)) - (let (v208 i32) (add.wrapping v132 v207)) - (let (v211 i32) (call #::write_str v208 v209 v210)) - (let (v212 i1) (neq v211 0)) - (condbr v212 (block 2 v247 v131 v132) (block 12))) + (let (v132 u32) (bitcast v131)) + (let (v133 u8) (trunc v132)) + (let (v134 u32) (bitcast v130)) + (let (v135 u32) (add.checked v134 27)) + (let (v136 (ptr u8)) (inttoptr v135)) + (store v136 v133) + (let (v138 u32) (bitcast v137)) + (let (v139 u32) (add.checked v138 20)) + (let (v140 u32) (mod.unchecked v139 4)) + (assertz 250 v140) + (let (v141 (ptr i64)) (inttoptr v139)) + (let (v142 i64) (load v141)) + (let (v143 u32) (bitcast v130)) + (let (v144 u32) (add.checked v143 12)) + (let (v145 u32) (mod.unchecked v144 4)) + (assertz 250 v145) + (let (v146 (ptr i64)) (inttoptr v144)) + (store v146 v142) + (let (v147 i32) (const.i32 1048932)) + (let (v148 u32) (bitcast v130)) + (let (v149 u32) (add.checked v148 52)) + (let (v150 u32) (mod.unchecked v149 4)) + (assertz 250 v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v147) + (let (v152 i32) (const.i32 27)) + (let (v153 i32) (add.wrapping v130 v152)) + (let (v154 u32) (bitcast v130)) + (let (v155 u32) (add.checked v154 20)) + (let (v156 u32) (mod.unchecked v155 4)) + (assertz 250 v156) + (let (v157 (ptr i32)) (inttoptr v155)) + (store v157 v153) + (let (v158 u32) (bitcast v137)) + (let (v159 u32) (add.checked v158 8)) + (let (v160 u32) (mod.unchecked v159 4)) + (assertz 250 v160) + (let (v161 (ptr i64)) (inttoptr v159)) + (let (v162 i64) (load v161)) + (let (v163 u32) (bitcast v130)) + (let (v164 u32) (add.checked v163 36)) + (let (v165 u32) (mod.unchecked v164 4)) + (assertz 250 v165) + (let (v166 (ptr i64)) (inttoptr v164)) + (store v166 v162) + (let (v167 u32) (bitcast v137)) + (let (v168 u32) (mod.unchecked v167 4)) + (assertz 250 v168) + (let (v169 (ptr i64)) (inttoptr v167)) + (let (v170 i64) (load v169)) + (let (v172 u32) (bitcast v130)) + (let (v173 u32) (add.checked v172 56)) + (let (v174 u32) (mod.unchecked v173 4)) + (assertz 250 v174) + (let (v175 (ptr i32)) (inttoptr v173)) + (store v175 v171) + (let (v176 u32) (bitcast v137)) + (let (v177 u32) (add.checked v176 16)) + (let (v178 u32) (mod.unchecked v177 4)) + (assertz 250 v178) + (let (v179 (ptr i32)) (inttoptr v177)) + (let (v180 i32) (load v179)) + (let (v181 u32) (bitcast v130)) + (let (v182 u32) (add.checked v181 44)) + (let (v183 u32) (mod.unchecked v182 4)) + (assertz 250 v183) + (let (v184 (ptr i32)) (inttoptr v182)) + (store v184 v180) + (let (v185 u32) (bitcast v137)) + (let (v186 u32) (add.checked v185 32)) + (let (v187 (ptr u8)) (inttoptr v186)) + (let (v188 u8) (load v187)) + (let (v189 i32) (zext v188)) + (let (v190 u32) (bitcast v189)) + (let (v191 u8) (trunc v190)) + (let (v192 u32) (bitcast v130)) + (let (v193 u32) (add.checked v192 60)) + (let (v194 (ptr u8)) (inttoptr v193)) + (store v194 v191) + (let (v195 u32) (bitcast v130)) + (let (v196 u32) (add.checked v195 28)) + (let (v197 u32) (mod.unchecked v196 4)) + (assertz 250 v197) + (let (v198 (ptr i64)) (inttoptr v196)) + (store v198 v170) + (let (v199 i32) (const.i32 12)) + (let (v200 i32) (add.wrapping v130 v199)) + (let (v201 u32) (bitcast v130)) + (let (v202 u32) (add.checked v201 48)) + (let (v203 u32) (mod.unchecked v202 4)) + (assertz 250 v203) + (let (v204 (ptr i32)) (inttoptr v202)) + (store v204 v200) + (let (v205 i32) (const.i32 12)) + (let (v206 i32) (add.wrapping v130 v205)) + (let (v209 i32) (call #::write_str v206 v207 v208)) + (let (v210 i1) (neq v209 0)) + (condbr v210 (block 2 v245 v129 v130) (block 12))) (block 10 - (let (v107 i32) (const.i32 1)) - (let (v108 u32) (bitcast v27)) - (let (v109 u32) (add.checked v108 20)) - (let (v110 u32) (mod.unchecked v109 4)) - (assertz 250 v110) - (let (v111 (ptr i32)) (inttoptr v109)) - (let (v112 i32) (load v111)) - (let (v113 i32) (const.i32 1048961)) - (let (v114 i32) (const.i32 3)) - (let (v115 u32) (bitcast v27)) - (let (v116 u32) (add.checked v115 24)) - (let (v117 u32) (mod.unchecked v116 4)) - (assertz 250 v117) - (let (v118 (ptr i32)) (inttoptr v116)) - (let (v119 i32) (load v118)) - (let (v120 u32) (bitcast v119)) - (let (v121 u32) (add.checked v120 12)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (let (v124 i32) (load v123)) - (let (v125 i1) (neq v124 0)) - (condbr v125 (block 2 v0 v107 v10) (block 11))) + (let (v106 u32) (bitcast v27)) + (let (v107 u32) (add.checked v106 20)) + (let (v108 u32) (mod.unchecked v107 4)) + (assertz 250 v108) + (let (v109 (ptr i32)) (inttoptr v107)) + (let (v110 i32) (load v109)) + (let (v111 i32) (const.i32 1048965)) + (let (v112 i32) (const.i32 3)) + (let (v113 u32) (bitcast v27)) + (let (v114 u32) (add.checked v113 24)) + (let (v115 u32) (mod.unchecked v114 4)) + (assertz 250 v115) + (let (v116 (ptr i32)) (inttoptr v114)) + (let (v117 i32) (load v116)) + (let (v118 u32) (bitcast v117)) + (let (v119 u32) (add.checked v118 12)) + (let (v120 u32) (mod.unchecked v119 4)) + (assertz 250 v120) + (let (v121 (ptr i32)) (inttoptr v119)) + (let (v122 i32) (load v121)) + (let (v123 i1) (neq v122 0)) + (condbr v123 (block 2 v0 v102 v10) (block 11))) (block 11 - (let (v126 u32) (bitcast v27)) - (let (v127 u32) (add.checked v126 28)) - (let (v128 u32) (mod.unchecked v127 4)) - (assertz 250 v128) - (let (v129 (ptr i32)) (inttoptr v127)) - (let (v130 i32) (load v129)) - (br (block 9 v10 v27 v130 v1 v2 v3 v4 v0))) + (let (v124 u32) (bitcast v27)) + (let (v125 u32) (add.checked v124 28)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (br (block 9 v10 v27 v128 v1 v2 v3 v4 v0))) (block 12 - (let (v213 i32) (const.i32 12)) - (let (v214 i32) (add.wrapping v132 v213)) - (let (v215 i32) (const.i32 1048924)) - (let (v216 i32) (const.i32 2)) - (let (v217 i32) (call #::write_str v214 v215 v216)) - (let (v218 i1) (neq v217 0)) - (condbr v218 (block 2 v247 v131 v132) (block 13))) + (let (v211 i32) (const.i32 12)) + (let (v212 i32) (add.wrapping v130 v211)) + (let (v213 i32) (const.i32 1048928)) + (let (v214 i32) (const.i32 2)) + (let (v215 i32) (call #::write_str v212 v213 v214)) + (let (v216 i1) (neq v215 0)) + (condbr v216 (block 2 v245 v129 v130) (block 13))) (block 13 - (let (v220 i32) (const.i32 28)) - (let (v221 i32) (add.wrapping v132 v220)) - (let (v223 u32) (bitcast v222)) - (let (v224 u32) (add.checked v223 12)) - (let (v225 u32) (mod.unchecked v224 4)) - (assertz 250 v225) - (let (v226 (ptr i32)) (inttoptr v224)) - (let (v227 i32) (load v226)) - (let (v228 i1) (neq v227 0)) - (condbr v228 (block 2 v247 v131 v132) (block 14))) + (let (v218 i32) (const.i32 28)) + (let (v219 i32) (add.wrapping v130 v218)) + (let (v221 u32) (bitcast v220)) + (let (v222 u32) (add.checked v221 12)) + (let (v223 u32) (mod.unchecked v222 4)) + (assertz 250 v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (let (v225 i32) (load v224)) + (let (v226 i1) (neq v225 0)) + (condbr v226 (block 2 v245 v129 v130) (block 14))) (block 14 - (let (v229 u32) (bitcast v132)) - (let (v230 u32) (add.checked v229 48)) - (let (v231 u32) (mod.unchecked v230 4)) - (assertz 250 v231) - (let (v232 (ptr i32)) (inttoptr v230)) - (let (v233 i32) (load v232)) - (let (v234 i32) (const.i32 1048964)) - (let (v235 i32) (const.i32 2)) - (let (v236 u32) (bitcast v132)) - (let (v237 u32) (add.checked v236 52)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i32)) (inttoptr v237)) - (let (v240 i32) (load v239)) - (let (v241 u32) (bitcast v240)) - (let (v242 u32) (add.checked v241 12)) - (let (v243 u32) (mod.unchecked v242 4)) - (assertz 250 v243) - (let (v244 (ptr i32)) (inttoptr v242)) - (let (v245 i32) (load v244)) - (br (block 2 v247 v245 v132))) + (let (v227 u32) (bitcast v130)) + (let (v228 u32) (add.checked v227 48)) + (let (v229 u32) (mod.unchecked v228 4)) + (assertz 250 v229) + (let (v230 (ptr i32)) (inttoptr v228)) + (let (v231 i32) (load v230)) + (let (v232 i32) (const.i32 1048968)) + (let (v233 i32) (const.i32 2)) + (let (v234 u32) (bitcast v130)) + (let (v235 u32) (add.checked v234 52)) + (let (v236 u32) (mod.unchecked v235 4)) + (assertz 250 v236) + (let (v237 (ptr i32)) (inttoptr v235)) + (let (v238 i32) (load v237)) + (let (v239 u32) (bitcast v238)) + (let (v240 u32) (add.checked v239 12)) + (let (v241 u32) (mod.unchecked v240 4)) + (assertz 250 v241) + (let (v242 (ptr i32)) (inttoptr v240)) + (let (v243 i32) (load v242)) + (br (block 2 v245 v243 v130))) ) (func (export #<&T as core::fmt::Display>::fmt) @@ -3438,7 +3400,7 @@ (condbr v61 (block 6) (block 7))) (block 3 - (let (v44 i32) (const.i32 1048784)) + (let (v44 i32) (const.i32 1048788)) (let (v45 u32) (bitcast v11)) (let (v46 u32) (add.checked v45 24)) (let (v47 u32) (mod.unchecked v46 4)) @@ -3449,7 +3411,7 @@ (br (block 2 v11 v49 v5 v6))) (block 4 - (let (v38 i32) (const.i32 1048782)) + (let (v38 i32) (const.i32 1048786)) (let (v39 u32) (bitcast v11)) (let (v40 u32) (add.checked v39 24)) (let (v41 u32) (mod.unchecked v40 4)) @@ -3460,7 +3422,7 @@ (br (block 2 v11 v43 v5 v6))) (block 5 - (let (v32 i32) (const.i32 1048780)) + (let (v32 i32) (const.i32 1048784)) (let (v33 u32) (bitcast v11)) (let (v34 u32) (add.checked v33 24)) (let (v35 u32) (mod.unchecked v34 4)) @@ -3521,7 +3483,7 @@ (assertz 250 v167) (let (v168 (ptr i32)) (inttoptr v166)) (store v168 v164) - (let (v169 i32) (const.i32 1048892)) + (let (v169 i32) (const.i32 1048896)) (let (v170 u32) (bitcast v50)) (let (v171 u32) (add.checked v170 88)) (let (v172 u32) (mod.unchecked v171 4)) @@ -3535,7 +3497,7 @@ (assertz 250 v177) (let (v178 (ptr i64)) (inttoptr v176)) (store v178 v174) - (let (v179 i32) (const.i32 8)) + (let (v179 i32) (const.i32 7)) (let (v180 u32) (bitcast v179)) (let (v181 u64) (zext v180)) (let (v182 i64) (bitcast v181)) @@ -3566,7 +3528,7 @@ (assertz 250 v204) (let (v205 (ptr i64)) (inttoptr v203)) (store v205 v201) - (let (v206 i32) (const.i32 10)) + (let (v206 i32) (const.i32 9)) (let (v207 u32) (bitcast v206)) (let (v208 u64) (zext v207)) (let (v209 i64) (bitcast v208)) @@ -3585,7 +3547,7 @@ (assertz 250 v221) (let (v222 (ptr i64)) (inttoptr v220)) (store v222 v218) - (let (v223 i32) (const.i32 9)) + (let (v223 i32) (const.i32 8)) (let (v224 u32) (bitcast v223)) (let (v225 u64) (zext v224)) (let (v226 i64) (bitcast v225)) @@ -3625,7 +3587,7 @@ (assertz 250 v65) (let (v66 (ptr i32)) (inttoptr v64)) (store v66 v62) - (let (v67 i32) (const.i32 1048840)) + (let (v67 i32) (const.i32 1048844)) (let (v68 u32) (bitcast v50)) (let (v69 u32) (add.checked v68 88)) (let (v70 u32) (mod.unchecked v69 4)) @@ -3639,7 +3601,7 @@ (assertz 250 v75) (let (v76 (ptr i64)) (inttoptr v74)) (store v76 v72) - (let (v77 i32) (const.i32 8)) + (let (v77 i32) (const.i32 7)) (let (v78 u32) (bitcast v77)) (let (v79 u64) (zext v78)) (let (v80 i64) (bitcast v79)) @@ -3670,7 +3632,7 @@ (assertz 250 v102) (let (v103 (ptr i64)) (inttoptr v101)) (store v103 v99) - (let (v104 i32) (const.i32 9)) + (let (v104 i32) (const.i32 8)) (let (v105 u32) (bitcast v104)) (let (v106 u64) (zext v105)) (let (v107 i64) (bitcast v106)) @@ -3776,413 +3738,447 @@ (let (v20 i32) (load v19)) (let (v21 i32) (const.i32 0)) (let (v22 i32) (const.i32 0)) - (br (block 2 v21 v2 v1 v22 v20 v15 v11 v6))) + (let (v23 i32) (const.i32 0)) + (let (v24 i32) (const.i32 0)) + (br (block 3 v24 v23 v2 v1 v22 v20 v15 v11 v6 v21))) (block 1 (param v3 i32) (ret v3)) - (block 2 - (param v23 i32) - (param v24 i32) - (param v210 i32) - (param v221 i32) - (param v240 i32) - (param v259 i32) - (param v273 i32) - (param v304 i32) - (let (v25 u32) (bitcast v23)) - (let (v26 u32) (bitcast v24)) - (let (v27 i1) (gt v25 v26)) - (let (v28 i32) (sext v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 5 v221 v24 v240 v259 v273 v304 v210 v23) (block 6))) + (block 2 (param v370 i32) + (br (block 1 v370))) (block 3 - (br (block 1 v345))) + (param v25 i32) + (param v29 i32) + (param v30 i32) + (param v214 i32) + (param v225 i32) + (param v243 i32) + (param v262 i32) + (param v276 i32) + (param v304 i32) + (param v371 i32) + (let (v26 i32) (const.i32 1)) + (let (v27 i32) (band v25 v26)) + (let (v28 i1) (neq v27 0)) + (condbr v28 (block 2 v371) (block 5))) (block 4 - (param v236 i32) - (param v255 i32) - (param v269 i32) + (let (v369 i32) (const.i32 1)) + (br (block 2 v369))) + + (block 5 + (let (v31 u32) (bitcast v29)) + (let (v32 u32) (bitcast v30)) + (let (v33 i1) (gt v31 v32)) + (let (v34 i32) (sext v33)) + (let (v35 i1) (neq v34 0)) + (condbr v35 (block 7 v225 v30 v243 v262 v276 v304 v214 v29 v371) (block 8))) + + (block 6 + (param v239 i32) + (param v258 i32) + (param v272 i32) (param v291 i32) (param v293 i32) (param v300 i32) (param v322 i32) (param v335 i32) - (param v348 i32) - (param v355 i32) - (param v359 i32) - (let (v248 u32) (bitcast v236)) - (let (v249 (ptr u8)) (inttoptr v248)) - (let (v250 u8) (load v249)) - (let (v251 i32) (zext v250)) - (let (v252 i1) (eq v251 0)) - (let (v253 i32) (zext v252)) - (let (v254 i1) (neq v253 0)) - (condbr v254 (block 43 v291 v293 v300 v322 v236 v335 v255 v269 v348 v355 v359) (block 44))) + (param v351 i32) + (param v363 i32) + (param v367 i32) + (param v374 i32) + (let (v251 u32) (bitcast v239)) + (let (v252 (ptr u8)) (inttoptr v251)) + (let (v253 u8) (load v252)) + (let (v254 i32) (zext v253)) + (let (v255 i1) (eq v254 0)) + (let (v256 i32) (zext v255)) + (let (v257 i1) (neq v256 0)) + (condbr v257 (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374) (block 47))) - (block 5 - (param v220 i32) - (param v231 i32) - (param v247 i32) - (param v266 i32) - (param v280 i32) + (block 7 + (param v224 i32) + (param v235 i32) + (param v250 i32) + (param v269 i32) + (param v283 i32) (param v311 i32) (param v323 i32) - (param v356 i32) - (let (v219 i32) (const.i32 1)) - (let (v232 i1) (neq v220 v231)) - (let (v233 i32) (zext v232)) - (let (v234 i1) (neq v233 0)) - (condbr v234 (block 4 v247 v266 v280 v231 v220 v311 v323 v220 v219 v356 v231) (block 42))) - - (block 6 - (br (block 7 v210 v23 v24 v221 v240 v259 v273 v304))) - - (block 7 - (param v30 i32) - (param v31 i32) - (param v33 i32) - (param v222 i32) - (param v239 i32) - (param v258 i32) - (param v272 i32) - (param v303 i32) - (let (v32 i32) (add.wrapping v30 v31)) - (let (v34 i32) (sub.wrapping v33 v31)) - (let (v35 i32) (const.i32 8)) - (let (v36 u32) (bitcast v34)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (lt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 11) (block 12))) + (param v364 i32) + (param v384 i32) + (let (v223 i32) (const.i32 1)) + (let (v236 i1) (eq v224 v235)) + (let (v237 i32) (zext v236)) + (let (v238 i1) (neq v237 0)) + (condbr v238 (block 2 v384) (block 44))) (block 8 - (br (block 5 v223 v204 v241 v260 v274 v305 v211 v203))) + (br (block 9 v214 v29 v30 v225 v243 v262 v276 v304 v25 v371))) (block 9 - (param v175 i32) - (param v176 i32) - (param v186 i32) - (param v192 i32) - (param v212 i32) - (param v224 i32) - (param v237 i32) - (param v256 i32) - (param v270 i32) - (param v301 i32) - (let (v183 i32) (add.wrapping v175 v176)) - (let (v184 i32) (const.i32 1)) - (let (v185 i32) (add.wrapping v183 v184)) - (let (v187 u32) (bitcast v183)) - (let (v188 u32) (bitcast v186)) - (let (v189 i1) (gte v187 v188)) - (let (v190 i32) (zext v189)) - (let (v191 i1) (neq v190 0)) - (condbr v191 (block 38 v185 v186 v212 v224 v237 v256 v270 v301) (block 39))) + (param v36 i32) + (param v37 i32) + (param v39 i32) + (param v226 i32) + (param v242 i32) + (param v261 i32) + (param v275 i32) + (param v303 i32) + (param v354 i32) + (param v377 i32) + (let (v38 i32) (add.wrapping v36 v37)) + (let (v40 i32) (sub.wrapping v39 v37)) + (let (v41 i32) (const.i32 7)) + (let (v42 u32) (bitcast v40)) + (let (v43 u32) (bitcast v41)) + (let (v44 i1) (gt v42 v43)) + (let (v45 i32) (sext v44)) + (let (v46 i1) (neq v45 0)) + (condbr v46 (block 14) (block 15))) (block 10 - (param v143 i32) - (param v146 i32) - (param v150 i32) - (param v171 i32) + (br (block 7 v227 v208 v244 v263 v277 v305 v215 v207 v378))) + + (block 11 (param v180 i32) + (param v181 i32) + (param v191 i32) + (param v197 i32) (param v216 i32) (param v228 i32) - (param v244 i32) - (param v263 i32) - (param v277 i32) - (param v308 i32) - (let (v147 i1) (neq v143 v146)) - (let (v148 i32) (zext v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 31) (block 32))) - - (block 11 - (let (v121 i1) (neq v33 v31)) - (let (v122 i32) (zext v121)) - (let (v123 i1) (neq v122 0)) - (condbr v123 (block 25) (block 26))) + (param v240 i32) + (param v259 i32) + (param v273 i32) + (param v301 i32) + (param v352 i32) + (param v375 i32) + (let (v188 i32) (add.wrapping v180 v181)) + (let (v189 i32) (const.i32 1)) + (let (v190 i32) (add.wrapping v188 v189)) + (let (v192 u32) (bitcast v188)) + (let (v193 u32) (bitcast v191)) + (let (v194 i1) (gte v192 v193)) + (let (v195 i32) (zext v194)) + (let (v196 i1) (neq v195 0)) + (condbr v196 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 41))) (block 12 - (let (v41 i32) (const.i32 3)) - (let (v42 i32) (add.wrapping v32 v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 i32) (sub.wrapping v44 v32)) - (let (v46 i1) (eq v45 0)) - (let (v47 i32) (zext v46)) - (let (v48 i1) (neq v47 0)) - (condbr v48 (block 14) (block 15))) + (param v148 i32) + (param v149 i32) + (param v155 i32) + (param v176 i32) + (param v185 i32) + (param v220 i32) + (param v232 i32) + (param v247 i32) + (param v266 i32) + (param v280 i32) + (param v308 i32) + (param v358 i32) + (param v381 i32) + (let (v152 i1) (neq v148 v149)) + (let (v153 i32) (zext v152)) + (let (v154 i1) (neq v153 0)) + (condbr v154 (block 33) (block 34))) (block 13 - (param v117 i32) - (param v119 i32) - (param v120 i32) - (param v145 i32) - (param v153 i32) - (param v173 i32) - (param v182 i32) - (param v218 i32) - (param v230 i32) - (param v246 i32) - (param v265 i32) - (param v279 i32) - (param v310 i32) - (br (block 21 v117 v119 v120 v145 v153 v173 v182 v218 v230 v246 v265 v279 v310))) + (let (v129 i32) (const.i32 0)) + (br (block 29 v38 v129 v40 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 14 - (let (v75 i32) (const.i32 -8)) - (let (v76 i32) (add.wrapping v34 v75)) - (br (block 13 v44 v45 v76 v34 v33 v32 v31 v30 v222 v239 v258 v272 v303))) + (let (v50 i32) (const.i32 3)) + (let (v51 i32) (add.wrapping v38 v50)) + (let (v52 i32) (const.i32 -4)) + (let (v53 i32) (band v51 v52)) + (let (v54 i32) (sub.wrapping v53 v38)) + (let (v55 i1) (eq v54 0)) + (let (v56 i32) (zext v55)) + (let (v57 i1) (neq v56 0)) + (condbr v57 (block 18) (block 19))) (block 15 - (let (v49 i32) (const.i32 0)) - (br (block 16 v32 v49 v45 v34 v44 v33 v31 v30 v222 v239 v258 v272 v303))) + (let (v47 i1) (neq v39 v37)) + (let (v48 i32) (zext v47)) + (let (v49 i1) (neq v48 0)) + (condbr v49 (block 13) (block 16))) (block 16 - (param v50 i32) - (param v51 i32) - (param v61 i32) - (param v67 i32) - (param v118 i32) - (param v151 i32) - (param v177 i32) - (param v213 i32) - (param v225 i32) - (param v238 i32) - (param v257 i32) - (param v271 i32) - (param v302 i32) - (let (v52 i32) (add.wrapping v50 v51)) - (let (v53 u32) (bitcast v52)) - (let (v54 (ptr u8)) (inttoptr v53)) - (let (v55 u8) (load v54)) - (let (v56 i32) (zext v55)) - (let (v57 i32) (const.i32 10)) - (let (v58 i1) (eq v56 v57)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 9 v51 v177 v151 v50 v213 v225 v238 v257 v271 v302) (block 18))) + (br (block 7 v226 v39 v242 v261 v275 v303 v36 v39 v377))) (block 17 - (let (v68 i32) (const.i32 -8)) - (let (v69 i32) (add.wrapping v67 v68)) - (let (v70 u32) (bitcast v61)) - (let (v71 u32) (bitcast v69)) - (let (v72 i1) (lte v70 v71)) - (let (v73 i32) (sext v72)) - (let (v74 i1) (neq v73 0)) - (condbr v74 (block 13 v118 v61 v69 v67 v151 v50 v177 v213 v225 v238 v257 v271 v302) (block 20))) + (param v125 i32) + (param v127 i32) + (param v128 i32) + (param v151 i32) + (param v158 i32) + (param v178 i32) + (param v187 i32) + (param v222 i32) + (param v234 i32) + (param v249 i32) + (param v268 i32) + (param v282 i32) + (param v310 i32) + (param v360 i32) + (param v383 i32) + (br (block 25 v125 v127 v128 v151 v158 v178 v187 v222 v234 v249 v268 v282 v310 v360 v383))) (block 18 - (let (v62 i32) (const.i32 1)) - (let (v63 i32) (add.wrapping v51 v62)) - (let (v64 i1) (neq v61 v63)) - (let (v65 i32) (zext v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v50 v63 v61 v67 v118 v151 v177 v213 v225 v238 v257 v271 v302) (block 19))) + (let (v84 i32) (const.i32 -8)) + (let (v85 i32) (add.wrapping v40 v84)) + (br (block 17 v53 v54 v85 v40 v39 v38 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 19 - (br (block 17))) + (let (v58 i32) (const.i32 0)) + (br (block 20 v38 v58 v54 v40 v53 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 20 - (br (block 10 v67 v61 v151 v50 v177 v213 v225 v238 v257 v271 v302))) - - (block 21 - (param v77 i32) - (param v108 i32) - (param v111 i32) - (param v144 i32) - (param v152 i32) - (param v172 i32) - (param v181 i32) + (param v59 i32) + (param v60 i32) + (param v70 i32) + (param v76 i32) + (param v126 i32) + (param v156 i32) + (param v182 i32) (param v217 i32) - (param v229 i32) - (param v245 i32) - (param v264 i32) - (param v278 i32) - (param v309 i32) - (let (v78 i32) (const.i32 4)) - (let (v79 i32) (add.wrapping v77 v78)) - (let (v80 u32) (bitcast v79)) - (let (v81 u32) (mod.unchecked v80 4)) - (assertz 250 v81) - (let (v82 (ptr i32)) (inttoptr v80)) - (let (v83 i32) (load v82)) - (let (v84 i32) (const.i32 168430090)) - (let (v85 i32) (bxor v83 v84)) - (let (v86 i32) (const.i32 -16843009)) - (let (v87 i32) (add.wrapping v85 v86)) - (let (v88 i32) (const.i32 -1)) - (let (v89 i32) (bxor v83 v88)) - (let (v90 i32) (band v87 v89)) - (let (v91 u32) (bitcast v77)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 i32) (const.i32 168430090)) - (let (v96 i32) (bxor v94 v95)) - (let (v97 i32) (const.i32 -16843009)) - (let (v98 i32) (add.wrapping v96 v97)) - (let (v99 i32) (const.i32 -1)) - (let (v100 i32) (bxor v94 v99)) - (let (v101 i32) (band v98 v100)) - (let (v102 i32) (bor v90 v101)) - (let (v103 i32) (const.i32 -2139062144)) - (let (v104 i32) (band v102 v103)) - (let (v105 i1) (neq v104 0)) - (condbr v105 (block 10 v144 v108 v152 v172 v181 v217 v229 v245 v264 v278 v309) (block 23))) + (param v229 i32) + (param v241 i32) + (param v260 i32) + (param v274 i32) + (param v302 i32) + (param v353 i32) + (param v376 i32) + (let (v61 i32) (add.wrapping v59 v60)) + (let (v62 u32) (bitcast v61)) + (let (v63 (ptr u8)) (inttoptr v62)) + (let (v64 u8) (load v63)) + (let (v65 i32) (zext v64)) + (let (v66 i32) (const.i32 10)) + (let (v67 i1) (eq v65 v66)) + (let (v68 i32) (zext v67)) + (let (v69 i1) (neq v68 0)) + (condbr v69 (block 11 v60 v182 v156 v59 v217 v229 v241 v260 v274 v302 v353 v376) (block 22))) + + (block 21 + (let (v77 i32) (const.i32 -8)) + (let (v78 i32) (add.wrapping v76 v77)) + (let (v79 u32) (bitcast v70)) + (let (v80 u32) (bitcast v78)) + (let (v81 i1) (lte v79 v80)) + (let (v82 i32) (sext v81)) + (let (v83 i1) (neq v82 0)) + (condbr v83 (block 17 v126 v70 v78 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 24))) - (block 22) + (block 22 + (let (v71 i32) (const.i32 1)) + (let (v72 i32) (add.wrapping v60 v71)) + (let (v73 i1) (neq v70 v72)) + (let (v74 i32) (zext v73)) + (let (v75 i1) (neq v74 0)) + (condbr v75 (block 20 v59 v72 v70 v76 v126 v156 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 23))) (block 23 - (let (v106 i32) (const.i32 8)) - (let (v107 i32) (add.wrapping v77 v106)) - (let (v109 i32) (const.i32 8)) - (let (v110 i32) (add.wrapping v108 v109)) - (let (v112 u32) (bitcast v110)) - (let (v113 u32) (bitcast v111)) - (let (v114 i1) (lte v112 v113)) - (let (v115 i32) (sext v114)) - (let (v116 i1) (neq v115 0)) - (condbr v116 (block 21 v107 v110 v111 v144 v152 v172 v181 v217 v229 v245 v264 v278 v309) (block 24))) + (br (block 21))) (block 24 - (br (block 10 v144 v110 v152 v172 v181 v217 v229 v245 v264 v278 v309))) + (br (block 12 v70 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376))) (block 25 - (let (v124 i32) (const.i32 0)) - (br (block 27 v32 v124 v34 v33 v31 v30 v222 v239 v258 v272 v303))) - - (block 26 - (br (block 5 v222 v33 v239 v258 v272 v303 v30 v33))) + (param v87 i32) + (param v116 i32) + (param v119 i32) + (param v150 i32) + (param v157 i32) + (param v177 i32) + (param v186 i32) + (param v221 i32) + (param v233 i32) + (param v248 i32) + (param v267 i32) + (param v281 i32) + (param v309 i32) + (param v359 i32) + (param v382 i32) + (let (v86 i32) (const.i32 16843008)) + (let (v88 u32) (bitcast v87)) + (let (v89 u32) (mod.unchecked v88 4)) + (assertz 250 v89) + (let (v90 (ptr i32)) (inttoptr v88)) + (let (v91 i32) (load v90)) + (let (v92 i32) (const.i32 168430090)) + (let (v93 i32) (bxor v91 v92)) + (let (v94 i32) (sub.wrapping v86 v93)) + (let (v95 i32) (bor v94 v91)) + (let (v96 i32) (const.i32 16843008)) + (let (v97 i32) (const.i32 4)) + (let (v98 i32) (add.wrapping v87 v97)) + (let (v99 u32) (bitcast v98)) + (let (v100 u32) (mod.unchecked v99 4)) + (assertz 250 v100) + (let (v101 (ptr i32)) (inttoptr v99)) + (let (v102 i32) (load v101)) + (let (v103 i32) (const.i32 168430090)) + (let (v104 i32) (bxor v102 v103)) + (let (v105 i32) (sub.wrapping v96 v104)) + (let (v106 i32) (bor v105 v102)) + (let (v107 i32) (band v95 v106)) + (let (v108 i32) (const.i32 -2139062144)) + (let (v109 i32) (band v107 v108)) + (let (v110 i32) (const.i32 -2139062144)) + (let (v111 i1) (neq v109 v110)) + (let (v112 i32) (zext v111)) + (let (v113 i1) (neq v112 0)) + (condbr v113 (block 12 v116 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 27))) + + (block 26) (block 27 - (param v125 i32) - (param v126 i32) - (param v136 i32) - (param v142 i32) - (param v178 i32) - (param v214 i32) - (param v226 i32) - (param v242 i32) - (param v261 i32) - (param v275 i32) - (param v306 i32) - (let (v127 i32) (add.wrapping v125 v126)) - (let (v128 u32) (bitcast v127)) - (let (v129 (ptr u8)) (inttoptr v128)) - (let (v130 u8) (load v129)) - (let (v131 i32) (zext v130)) - (let (v132 i32) (const.i32 10)) - (let (v133 i1) (eq v131 v132)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 9 v126 v178 v142 v125 v214 v226 v242 v261 v275 v306) (block 29))) + (let (v114 i32) (const.i32 8)) + (let (v115 i32) (add.wrapping v87 v114)) + (let (v117 i32) (const.i32 8)) + (let (v118 i32) (add.wrapping v116 v117)) + (let (v120 u32) (bitcast v118)) + (let (v121 u32) (bitcast v119)) + (let (v122 i1) (lte v120 v121)) + (let (v123 i32) (sext v122)) + (let (v124 i1) (neq v123 0)) + (condbr v124 (block 25 v115 v118 v119 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 28))) (block 28 - (br (block 5 v226 v142 v242 v261 v275 v306 v214 v142))) + (br (block 12 v118 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382))) (block 29 - (let (v137 i32) (const.i32 1)) - (let (v138 i32) (add.wrapping v126 v137)) - (let (v139 i1) (neq v136 v138)) - (let (v140 i32) (zext v139)) - (let (v141 i1) (neq v140 0)) - (condbr v141 (block 27 v125 v138 v136 v142 v178 v214 v226 v242 v261 v275 v306) (block 30))) + (param v130 i32) + (param v131 i32) + (param v141 i32) + (param v147 i32) + (param v183 i32) + (param v218 i32) + (param v230 i32) + (param v245 i32) + (param v264 i32) + (param v278 i32) + (param v306 i32) + (param v356 i32) + (param v379 i32) + (let (v132 i32) (add.wrapping v130 v131)) + (let (v133 u32) (bitcast v132)) + (let (v134 (ptr u8)) (inttoptr v133)) + (let (v135 u8) (load v134)) + (let (v136 i32) (zext v135)) + (let (v137 i32) (const.i32 10)) + (let (v138 i1) (eq v136 v137)) + (let (v139 i32) (zext v138)) + (let (v140 i1) (neq v139 0)) + (condbr v140 (block 11 v131 v183 v147 v130 v218 v230 v245 v264 v278 v306 v356 v379) (block 31))) (block 30 - (br (block 28))) + (br (block 7 v230 v147 v245 v264 v278 v306 v218 v147 v379))) (block 31 - (br (block 33 v171 v146 v143 v150 v180 v216 v228 v244 v263 v277 v308))) + (let (v142 i32) (const.i32 1)) + (let (v143 i32) (add.wrapping v131 v142)) + (let (v144 i1) (neq v141 v143)) + (let (v145 i32) (zext v144)) + (let (v146 i1) (neq v145 0)) + (condbr v146 (block 29 v130 v143 v141 v147 v183 v218 v230 v245 v264 v278 v306 v356 v379) (block 32))) (block 32 - (br (block 5 v228 v150 v244 v263 v277 v308 v216 v150))) + (br (block 30))) (block 33 - (param v154 i32) - (param v155 i32) - (param v165 i32) - (param v174 i32) - (param v179 i32) - (param v215 i32) - (param v227 i32) - (param v243 i32) - (param v262 i32) - (param v276 i32) - (param v307 i32) - (let (v156 i32) (add.wrapping v154 v155)) - (let (v157 u32) (bitcast v156)) - (let (v158 (ptr u8)) (inttoptr v157)) - (let (v159 u8) (load v158)) - (let (v160 i32) (zext v159)) - (let (v161 i32) (const.i32 10)) - (let (v162 i1) (neq v160 v161)) - (let (v163 i32) (zext v162)) - (let (v164 i1) (neq v163 0)) - (condbr v164 (block 35) (block 36))) + (br (block 35 v176 v148 v149 v155 v185 v220 v232 v247 v266 v280 v308 v358 v381))) (block 34 - (br (block 5 v227 v174 v243 v262 v276 v307 v215 v174))) + (br (block 7 v232 v155 v247 v266 v280 v308 v220 v155 v381))) (block 35 - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (add.wrapping v155 v166)) - (let (v168 i1) (neq v165 v167)) - (let (v169 i32) (zext v168)) - (let (v170 i1) (neq v169 0)) - (condbr v170 (block 33 v154 v167 v165 v174 v179 v215 v227 v243 v262 v276 v307) (block 37))) + (param v159 i32) + (param v160 i32) + (param v170 i32) + (param v179 i32) + (param v184 i32) + (param v219 i32) + (param v231 i32) + (param v246 i32) + (param v265 i32) + (param v279 i32) + (param v307 i32) + (param v357 i32) + (param v380 i32) + (let (v161 i32) (add.wrapping v159 v160)) + (let (v162 u32) (bitcast v161)) + (let (v163 (ptr u8)) (inttoptr v162)) + (let (v164 u8) (load v163)) + (let (v165 i32) (zext v164)) + (let (v166 i32) (const.i32 10)) + (let (v167 i1) (neq v165 v166)) + (let (v168 i32) (zext v167)) + (let (v169 i1) (neq v168 0)) + (condbr v169 (block 37) (block 38))) (block 36 - (br (block 9 v155 v179 v174 v154 v215 v227 v243 v262 v276 v307))) + (br (block 7 v231 v179 v246 v265 v279 v307 v219 v179 v380))) (block 37 - (br (block 34))) + (let (v171 i32) (const.i32 1)) + (let (v172 i32) (add.wrapping v160 v171)) + (let (v173 i1) (neq v170 v172)) + (let (v174 i32) (zext v173)) + (let (v175 i1) (neq v174 0)) + (condbr v175 (block 35 v159 v172 v170 v179 v184 v219 v231 v246 v265 v279 v307 v357 v380) (block 39))) (block 38 - (param v203 i32) - (param v204 i32) - (param v211 i32) - (param v223 i32) - (param v241 i32) - (param v260 i32) - (param v274 i32) - (param v305 i32) - (let (v205 u32) (bitcast v203)) - (let (v206 u32) (bitcast v204)) - (let (v207 i1) (lte v205 v206)) - (let (v208 i32) (sext v207)) - (let (v209 i1) (neq v208 0)) - (condbr v209 (block 7 v211 v203 v204 v223 v241 v260 v274 v305) (block 41))) + (br (block 11 v160 v184 v179 v159 v219 v231 v246 v265 v279 v307 v357 v380))) (block 39 - (let (v193 i32) (add.wrapping v192 v175)) - (let (v194 u32) (bitcast v193)) - (let (v195 (ptr u8)) (inttoptr v194)) - (let (v196 u8) (load v195)) - (let (v197 i32) (zext v196)) - (let (v198 i32) (const.i32 10)) - (let (v199 i1) (neq v197 v198)) - (let (v200 i32) (zext v199)) - (let (v201 i1) (neq v200 0)) - (condbr v201 (block 38 v185 v186 v212 v224 v237 v256 v270 v301) (block 40))) + (br (block 36))) (block 40 - (let (v202 i32) (const.i32 0)) - (br (block 4 v237 v256 v270 v185 v224 v301 v212 v185 v202 v185 v186))) + (param v207 i32) + (param v208 i32) + (param v215 i32) + (param v227 i32) + (param v244 i32) + (param v263 i32) + (param v277 i32) + (param v305 i32) + (param v355 i32) + (param v378 i32) + (let (v209 u32) (bitcast v207)) + (let (v210 u32) (bitcast v208)) + (let (v211 i1) (lte v209 v210)) + (let (v212 i32) (sext v211)) + (let (v213 i1) (neq v212 0)) + (condbr v213 (block 9 v215 v207 v208 v227 v244 v263 v277 v305 v355 v378) (block 43))) (block 41 - (br (block 8))) + (let (v198 i32) (add.wrapping v197 v180)) + (let (v199 u32) (bitcast v198)) + (let (v200 (ptr u8)) (inttoptr v199)) + (let (v201 u8) (load v200)) + (let (v202 i32) (zext v201)) + (let (v203 i32) (const.i32 10)) + (let (v204 i1) (neq v202 v203)) + (let (v205 i32) (zext v204)) + (let (v206 i1) (neq v205 0)) + (condbr v206 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 42))) (block 42 - (let (v235 i32) (const.i32 0)) - (ret v235)) + (br (block 6 v240 v259 v273 v190 v228 v301 v216 v190 v352 v190 v191 v375))) (block 43 + (br (block 10))) + + (block 44 + (br (block 6 v250 v269 v283 v235 v224 v311 v323 v224 v223 v364 v235 v384))) + + (block 45 + (br (block 4))) + + (block 46 (param v290 i32) (param v292 i32) (param v299 i32) @@ -4191,35 +4187,33 @@ (param v334 i32) (param v337 i32) (param v340 i32) - (param v347 i32) - (param v354 i32) - (param v358 i32) + (param v350 i32) + (param v362 i32) + (param v366 i32) + (param v373 i32) (let (v294 i32) (sub.wrapping v290 v292)) (let (v295 i32) (const.i32 0)) (let (v296 i1) (eq v290 v292)) (let (v297 i32) (zext v296)) (let (v298 i1) (neq v297 0)) - (condbr v298 (block 46 v321 v292 v327 v295 v334 v337 v294 v340 v347 v354 v358 v299) (block 47))) + (condbr v298 (block 49 v321 v292 v327 v295 v334 v337 v294 v340 v350 v362 v366 v299 v373) (block 50))) - (block 44 - (let (v267 i32) (const.i32 1048952)) - (let (v268 i32) (const.i32 4)) - (let (v281 u32) (bitcast v269)) - (let (v282 u32) (add.checked v281 12)) - (let (v283 u32) (mod.unchecked v282 4)) - (assertz 250 v283) - (let (v284 (ptr i32)) (inttoptr v282)) - (let (v285 i32) (load v284)) - (let (v286 i1) (eq v285 0)) - (let (v287 i32) (zext v286)) - (let (v288 i1) (neq v287 0)) - (condbr v288 (block 43 v291 v293 v300 v322 v236 v335 v255 v269 v348 v355 v359) (block 45))) + (block 47 + (let (v270 i32) (const.i32 1048956)) + (let (v271 i32) (const.i32 4)) + (let (v284 u32) (bitcast v272)) + (let (v285 u32) (add.checked v284 12)) + (let (v286 u32) (mod.unchecked v285 4)) + (assertz 250 v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (let (v288 i32) (load v287)) + (let (v289 i1) (neq v288 0)) + (condbr v289 (block 45) (block 48))) - (block 45 - (let (v289 i32) (const.i32 1)) - (ret v289)) + (block 48 + (br (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374))) - (block 46 + (block 49 (param v320 i32) (param v324 i32) (param v326 i32) @@ -4228,10 +4222,11 @@ (param v336 i32) (param v338 i32) (param v339 i32) - (param v346 i32) - (param v353 i32) - (param v357 i32) - (param v360 i32) + (param v349 i32) + (param v361 i32) + (param v365 i32) + (param v368 i32) + (param v372 i32) (let (v325 i32) (add.wrapping v320 v324)) (let (v329 u32) (bitcast v328)) (let (v330 u8) (trunc v329)) @@ -4244,13 +4239,12 @@ (assertz 250 v343) (let (v344 (ptr i32)) (inttoptr v342)) (let (v345 i32) (load v344)) - (let (v349 i32) (bor v345 v346)) - (let (v350 i1) (eq v349 0)) - (let (v351 i32) (zext v350)) - (let (v352 i1) (neq v351 0)) - (condbr v352 (block 2 v353 v357 v320 v333 v326 v336 v339 v360) (block 48))) + (let (v346 i1) (eq v345 0)) + (let (v347 i32) (zext v346)) + (let (v348 i1) (neq v347 0)) + (condbr v348 (block 3 v349 v361 v365 v320 v333 v326 v336 v339 v368 v372) (block 51))) - (block 47 + (block 50 (let (v312 i32) (add.wrapping v299 v290)) (let (v313 u32) (bitcast v312)) (let (v314 (ptr u8)) (inttoptr v313)) @@ -4259,10 +4253,10 @@ (let (v317 i32) (const.i32 10)) (let (v318 i1) (eq v316 v317)) (let (v319 i32) (zext v318)) - (br (block 46 v321 v292 v327 v319 v334 v337 v294 v340 v347 v354 v358 v299))) + (br (block 49 v321 v292 v327 v319 v334 v337 v294 v340 v350 v362 v366 v299 v373))) - (block 48 - (br (block 3))) + (block 51 + (br (block 45))) ) (func (export #::write_char) @@ -4320,7 +4314,7 @@ (br (block 1 v51))) (block 3 - (let (v25 i32) (const.i32 1048952)) + (let (v25 i32) (const.i32 1048956)) (let (v26 i32) (const.i32 4)) (let (v27 u32) (bitcast v8)) (let (v28 u32) (add.checked v27 12)) @@ -4352,103 +4346,96 @@ (let (v10 (ptr u8)) (inttoptr v9)) (let (v11 u8) (load v10)) (let (v12 i32) (zext v11)) - (let (v13 i1) (neq v12 0)) - (condbr v13 (block 2) (block 3))) + (let (v13 i1) (eq v12 0)) + (let (v14 i32) (zext v13)) + (let (v15 i1) (neq v14 0)) + (condbr v15 (block 2 v7) (block 3))) (block 1 (param v1 i32) (ret v1)) - (block 2 - (let (v19 i32) (const.i32 1)) - (let (v20 i32) (const.i32 255)) - (let (v21 i32) (band v7 v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 4 v0 v19) (block 5))) + (block 2 (param v73 i32) + (let (v74 i32) (const.i32 1)) + (let (v75 i32) (band v73 v74)) + (br (block 1 v75))) (block 3 - (let (v14 i32) (const.i32 255)) - (let (v15 i32) (band v7 v14)) - (let (v16 i32) (const.i32 0)) - (let (v17 i1) (neq v15 v16)) - (let (v18 i32) (zext v17)) - (ret v18)) + (let (v16 i32) (const.i32 1)) + (let (v17 i32) (const.i32 1)) + (let (v18 i32) (band v7 v17)) + (let (v19 i1) (neq v18 0)) + (condbr v19 (block 4 v0 v16) (block 5))) - (block 4 (param v74 i32) (param v75 i32) - (let (v76 u32) (bitcast v75)) - (let (v77 u8) (trunc v76)) - (let (v78 u32) (bitcast v74)) - (let (v79 u32) (add.checked v78 4)) - (let (v80 (ptr u8)) (inttoptr v79)) - (store v80 v77) - (br (block 1 v75))) + (block 4 (param v66 i32) (param v67 i32) + (let (v68 u32) (bitcast v67)) + (let (v69 u8) (trunc v68)) + (let (v70 u32) (bitcast v66)) + (let (v71 u32) (add.checked v70 4)) + (let (v72 (ptr u8)) (inttoptr v71)) + (store v72 v69) + (br (block 2 v67))) (block 5 - (let (v23 u32) (bitcast v0)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 u32) (bitcast v26)) - (let (v28 u32) (add.checked v27 28)) - (let (v29 (ptr u8)) (inttoptr v28)) - (let (v30 u8) (load v29)) - (let (v31 i32) (zext v30)) - (let (v32 i32) (const.i32 4)) - (let (v33 i32) (band v31 v32)) - (let (v34 i1) (neq v33 0)) - (condbr v34 (block 6) (block 7))) + (let (v20 u32) (bitcast v0)) + (let (v21 u32) (mod.unchecked v20 4)) + (assertz 250 v21) + (let (v22 (ptr i32)) (inttoptr v20)) + (let (v23 i32) (load v22)) + (let (v24 u32) (bitcast v23)) + (let (v25 u32) (add.checked v24 28)) + (let (v26 (ptr u8)) (inttoptr v25)) + (let (v27 u8) (load v26)) + (let (v28 i32) (zext v27)) + (let (v29 i32) (const.i32 4)) + (let (v30 i32) (band v28 v29)) + (let (v31 i1) (neq v30 0)) + (condbr v31 (block 6) (block 7))) (block 6 - (let (v57 u32) (bitcast v26)) - (let (v58 u32) (add.checked v57 20)) - (let (v59 u32) (mod.unchecked v58 4)) - (assertz 250 v59) - (let (v60 (ptr i32)) (inttoptr v58)) - (let (v61 i32) (load v60)) - (let (v62 i32) (const.i32 1048966)) - (let (v63 i32) (const.i32 1)) - (let (v64 u32) (bitcast v26)) - (let (v65 u32) (add.checked v64 24)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v68)) - (let (v70 u32) (add.checked v69 12)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (br (block 4 v0 v73))) + (let (v49 u32) (bitcast v23)) + (let (v50 u32) (add.checked v49 20)) + (let (v51 u32) (mod.unchecked v50 4)) + (assertz 250 v51) + (let (v52 (ptr i32)) (inttoptr v50)) + (let (v53 i32) (load v52)) + (let (v54 i32) (const.i32 1048970)) + (let (v55 i32) (const.i32 1)) + (let (v56 u32) (bitcast v23)) + (let (v57 u32) (add.checked v56 24)) + (let (v58 u32) (mod.unchecked v57 4)) + (assertz 250 v58) + (let (v59 (ptr i32)) (inttoptr v57)) + (let (v60 i32) (load v59)) + (let (v61 u32) (bitcast v60)) + (let (v62 u32) (add.checked v61 12)) + (let (v63 u32) (mod.unchecked v62 4)) + (assertz 250 v63) + (let (v64 (ptr i32)) (inttoptr v62)) + (let (v65 i32) (load v64)) + (br (block 4 v0 v65))) (block 7 - (let (v35 u32) (bitcast v26)) - (let (v36 u32) (add.checked v35 20)) - (let (v37 u32) (mod.unchecked v36 4)) - (assertz 250 v37) - (let (v38 (ptr i32)) (inttoptr v36)) - (let (v39 i32) (load v38)) - (let (v40 i32) (const.i32 1048967)) - (let (v41 i32) (const.i32 2)) - (let (v42 u32) (bitcast v26)) - (let (v43 u32) (add.checked v42 24)) - (let (v44 u32) (mod.unchecked v43 4)) - (assertz 250 v44) - (let (v45 (ptr i32)) (inttoptr v43)) - (let (v46 i32) (load v45)) - (let (v47 u32) (bitcast v46)) - (let (v48 u32) (add.checked v47 12)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (let (v51 i32) (load v50)) - (let (v52 u32) (bitcast v51)) - (let (v53 u8) (trunc v52)) - (let (v54 u32) (bitcast v41)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 (ptr u8)) (inttoptr v55)) - (store v56 v53) - (ret v51)) + (let (v32 u32) (bitcast v23)) + (let (v33 u32) (add.checked v32 20)) + (let (v34 u32) (mod.unchecked v33 4)) + (assertz 250 v34) + (let (v35 (ptr i32)) (inttoptr v33)) + (let (v36 i32) (load v35)) + (let (v37 i32) (const.i32 1048971)) + (let (v38 i32) (const.i32 2)) + (let (v39 u32) (bitcast v23)) + (let (v40 u32) (add.checked v39 24)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i32)) (inttoptr v40)) + (let (v43 i32) (load v42)) + (let (v44 u32) (bitcast v43)) + (let (v45 u32) (add.checked v44 12)) + (let (v46 u32) (mod.unchecked v45 4)) + (assertz 250 v46) + (let (v47 (ptr i32)) (inttoptr v45)) + (let (v48 i32) (load v47)) + (br (block 4 v0 v48))) ) (func (export #core::fmt::Formatter::pad_integral) @@ -4473,9 +4460,9 @@ (param v41 i32) (param v134 i32) (param v140 i32) - (param v162 i32) - (param v178 i32) - (param v184 i32) + (param v161 i32) + (param v180 i32) + (param v186 i32) (let (v30 i32) (const.i32 4)) (let (v31 i32) (band v29 v30)) (let (v32 i1) (neq v31 0)) @@ -4511,20 +4498,20 @@ (block 5 (param v139 i32) - (param v161 i32) - (param v167 i32) - (param v170 i32) - (param v177 i32) - (param v183 i32) - (param v199 i32) - (param v223 i32) + (param v160 i32) + (param v166 i32) + (param v169 i32) + (param v179 i32) + (param v185 i32) + (param v201 i32) + (param v222 i32) (let (v145 u32) (bitcast v139)) (let (v146 u32) (mod.unchecked v145 4)) (assertz 250 v146) (let (v147 (ptr i32)) (inttoptr v145)) (let (v148 i32) (load v147)) (let (v149 i1) (neq v148 0)) - (condbr v149 (block 24) (block 25))) + (condbr v149 (block 23) (block 24))) (block 6 (let (v35 i32) (const.i32 16)) @@ -4537,20 +4524,20 @@ (block 7 (let (v33 i32) (const.i32 0)) - (br (block 5 v140 v162 v33 v34 v178 v184 v134 v29))) + (br (block 5 v140 v161 v33 v34 v180 v186 v134 v29))) (block 8 (param v132 i32) (param v133 i32) (param v141 i32) - (param v163 i32) - (param v168 i32) - (param v171 i32) - (param v179 i32) - (param v185 i32) - (param v224 i32) + (param v162 i32) + (param v167 i32) + (param v170 i32) + (param v181 i32) + (param v187 i32) + (param v223 i32) (let (v138 i32) (add.wrapping v132 v133)) - (br (block 5 v141 v163 v168 v171 v179 v185 v138 v224))) + (br (block 5 v141 v162 v167 v170 v181 v187 v138 v223))) (block 9 (let (v43 i1) (neq v34 0)) @@ -4558,7 +4545,7 @@ (block 10 (let (v42 i32) (call #core::str::count::do_count_chars v41 v34)) - (br (block 8 v42 v134 v140 v162 v41 v34 v178 v184 v29))) + (br (block 8 v42 v134 v140 v161 v41 v34 v180 v186 v29))) (block 11 (let (v45 i32) (const.i32 3)) @@ -4573,7 +4560,7 @@ (block 12 (let (v44 i32) (const.i32 0)) - (br (block 8 v44 v134 v140 v162 v41 v34 v178 v184 v29))) + (br (block 8 v44 v134 v140 v161 v41 v34 v180 v186 v29))) (block 13 (param v107 i32) @@ -4582,27 +4569,27 @@ (param v131 i32) (param v135 i32) (param v142 i32) - (param v164 i32) - (param v172 i32) - (param v180 i32) - (param v186 i32) - (param v225 i32) + (param v163 i32) + (param v171 i32) + (param v182 i32) + (param v188 i32) + (param v224 i32) (let (v109 i1) (eq v107 0)) (let (v110 i32) (zext v109)) (let (v111 i1) (neq v110 0)) - (condbr v111 (block 8 v131 v135 v142 v164 v112 v172 v180 v186 v225) (block 19))) + (condbr v111 (block 8 v131 v135 v142 v163 v112 v171 v182 v188 v224) (block 19))) (block 14 (let (v55 i32) (const.i32 12)) (let (v56 i32) (band v34 v55)) (let (v57 i32) (const.i32 0)) (let (v58 i32) (const.i32 0)) - (br (block 16 v57 v41 v58 v56 v46 v134 v140 v162 v34 v178 v184 v29))) + (br (block 16 v57 v41 v58 v56 v46 v134 v140 v161 v34 v180 v186 v29))) (block 15 (let (v53 i32) (const.i32 0)) (let (v54 i32) (const.i32 0)) - (br (block 13 v46 v41 v54 v53 v134 v140 v162 v34 v178 v184 v29))) + (br (block 13 v46 v41 v54 v53 v134 v140 v161 v34 v180 v186 v29))) (block 16 (param v59 i32) @@ -4612,11 +4599,11 @@ (param v108 i32) (param v136 i32) (param v143 i32) - (param v165 i32) - (param v173 i32) - (param v181 i32) - (param v187 i32) - (param v226 i32) + (param v164 i32) + (param v172 i32) + (param v183 i32) + (param v189 i32) + (param v225 i32) (let (v62 i32) (add.wrapping v60 v61)) (let (v63 u32) (bitcast v62)) (let (v64 (ptr i8)) (inttoptr v63)) @@ -4661,17 +4648,17 @@ (let (v104 i1) (neq v101 v103)) (let (v105 i32) (zext v104)) (let (v106 i1) (neq v105 0)) - (condbr v106 (block 16 v100 v60 v103 v101 v108 v136 v143 v165 v173 v181 v187 v226) (block 18))) + (condbr v106 (block 16 v100 v60 v103 v101 v108 v136 v143 v164 v172 v183 v189 v225) (block 18))) (block 17 - (br (block 13 v108 v60 v103 v100 v136 v143 v165 v173 v181 v187 v226))) + (br (block 13 v108 v60 v103 v100 v136 v143 v164 v172 v183 v189 v225))) (block 18 (br (block 17))) (block 19 (let (v114 i32) (add.wrapping v112 v113)) - (br (block 20 v131 v114 v107 v135 v142 v164 v112 v172 v180 v186 v225))) + (br (block 20 v131 v114 v107 v135 v142 v163 v112 v171 v182 v188 v224))) (block 20 (param v115 i32) @@ -4679,12 +4666,12 @@ (param v127 i32) (param v137 i32) (param v144 i32) - (param v166 i32) - (param v169 i32) - (param v174 i32) - (param v182 i32) - (param v188 i32) - (param v227 i32) + (param v165 i32) + (param v168 i32) + (param v173 i32) + (param v184 i32) + (param v190 i32) + (param v226 i32) (let (v117 u32) (bitcast v116)) (let (v118 (ptr i8)) (inttoptr v117)) (let (v119 i8) (load v118)) @@ -4698,376 +4685,391 @@ (let (v128 i32) (const.i32 -1)) (let (v129 i32) (add.wrapping v127 v128)) (let (v130 i1) (neq v129 0)) - (condbr v130 (block 20 v124 v126 v129 v137 v144 v166 v169 v174 v182 v188 v227) (block 22))) + (condbr v130 (block 20 v124 v126 v129 v137 v144 v165 v168 v173 v184 v190 v226) (block 22))) (block 21 - (br (block 8 v124 v137 v144 v166 v169 v174 v182 v188 v227))) + (br (block 8 v124 v137 v144 v165 v168 v173 v184 v190 v226))) (block 22 (br (block 21))) - (block 23 (param v417 i32) - (br (block 1 v417))) + (block 23 + (let (v196 u32) (bitcast v139)) + (let (v197 u32) (add.checked v196 4)) + (let (v198 u32) (mod.unchecked v197 4)) + (assertz 250 v198) + (let (v199 (ptr i32)) (inttoptr v197)) + (let (v200 i32) (load v199)) + (let (v202 u32) (bitcast v200)) + (let (v203 u32) (bitcast v201)) + (let (v204 i1) (gt v202 v203)) + (let (v205 i32) (sext v204)) + (let (v206 i1) (neq v205 0)) + (condbr v206 (block 30) (block 31))) (block 24 - (let (v194 u32) (bitcast v139)) - (let (v195 u32) (add.checked v194 4)) - (let (v196 u32) (mod.unchecked v195 4)) - (assertz 250 v196) - (let (v197 (ptr i32)) (inttoptr v195)) - (let (v198 i32) (load v197)) - (let (v200 u32) (bitcast v198)) - (let (v201 u32) (bitcast v199)) - (let (v202 i1) (gt v200 v201)) - (let (v203 i32) (sext v202)) - (let (v204 i1) (neq v203 0)) - (condbr v204 (block 27) (block 28))) + (let (v150 u32) (bitcast v139)) + (let (v151 u32) (add.checked v150 20)) + (let (v152 u32) (mod.unchecked v151 4)) + (assertz 250 v152) + (let (v153 (ptr i32)) (inttoptr v151)) + (let (v154 i32) (load v153)) + (let (v155 u32) (bitcast v139)) + (let (v156 u32) (add.checked v155 24)) + (let (v157 u32) (mod.unchecked v156 4)) + (assertz 250 v157) + (let (v158 (ptr i32)) (inttoptr v156)) + (let (v159 i32) (load v158)) + (let (v174 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v154 v159 v160 v166 v169)) + (let (v175 i1) (eq v174 0)) + (let (v176 i32) (zext v175)) + (let (v177 i1) (neq v176 0)) + (condbr v177 (block 25) (block 26))) (block 25 - (let (v150 i32) (const.i32 1)) - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 20)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 u32) (bitcast v139)) - (let (v157 u32) (add.checked v156 24)) - (let (v158 u32) (mod.unchecked v157 4)) - (assertz 250 v158) - (let (v159 (ptr i32)) (inttoptr v157)) - (let (v160 i32) (load v159)) - (let (v175 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v155 v160 v161 v167 v170)) - (let (v176 i1) (neq v175 0)) - (condbr v176 (block 23 v150) (block 26))) + (let (v191 u32) (bitcast v159)) + (let (v192 u32) (add.checked v191 12)) + (let (v193 u32) (mod.unchecked v192 4)) + (assertz 250 v193) + (let (v194 (ptr i32)) (inttoptr v192)) + (let (v195 i32) (load v194)) + (ret v195)) (block 26 - (let (v189 u32) (bitcast v160)) - (let (v190 u32) (add.checked v189 12)) - (let (v191 u32) (mod.unchecked v190 4)) - (assertz 250 v191) - (let (v192 (ptr i32)) (inttoptr v190)) - (let (v193 i32) (load v192)) - (ret v193)) + (let (v178 i32) (const.i32 1)) + (ret v178)) - (block 27 - (let (v228 i32) (const.i32 8)) - (let (v229 i32) (band v223 v228)) - (let (v230 i1) (eq v229 0)) - (let (v231 i32) (zext v230)) - (let (v232 i1) (neq v231 0)) - (condbr v232 (block 30) (block 31))) + (block 27 (param v423 i32) + (br (block 1 v423))) (block 28 - (let (v205 i32) (const.i32 1)) - (let (v206 u32) (bitcast v139)) - (let (v207 u32) (add.checked v206 20)) - (let (v208 u32) (mod.unchecked v207 4)) - (assertz 250 v208) - (let (v209 (ptr i32)) (inttoptr v207)) - (let (v210 i32) (load v209)) - (let (v211 u32) (bitcast v139)) - (let (v212 u32) (add.checked v211 24)) - (let (v213 u32) (mod.unchecked v212 4)) - (assertz 250 v213) - (let (v214 (ptr i32)) (inttoptr v212)) - (let (v215 i32) (load v214)) - (let (v216 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v210 v215 v161 v167 v170)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 23 v205) (block 29))) + (let (v316 i32) (sub.wrapping v200 v201)) + (let (v317 u32) (bitcast v139)) + (let (v318 u32) (add.checked v317 32)) + (let (v319 (ptr u8)) (inttoptr v318)) + (let (v320 u8) (load v319)) + (let (v321 i32) (zext v320)) + (let (v322 u32) (cast v321)) + (switchv322 + (0 . (block 44)) + (1 . (block 44)) + (2 . (block 43)) + (3 . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)) + (_ . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)))) (block 29 - (let (v218 u32) (bitcast v215)) - (let (v219 u32) (add.checked v218 12)) - (let (v220 u32) (mod.unchecked v219 4)) - (assertz 250 v220) - (let (v221 (ptr i32)) (inttoptr v219)) - (let (v222 i32) (load v221)) - (ret v222)) + (let (v311 u32) (bitcast v216)) + (let (v312 u32) (add.checked v311 12)) + (let (v313 u32) (mod.unchecked v312 4)) + (assertz 250 v313) + (let (v314 (ptr i32)) (inttoptr v312)) + (let (v315 i32) (load v314)) + (br (block 27 v315))) (block 30 - (let (v310 i32) (sub.wrapping v198 v199)) - (let (v311 u32) (bitcast v139)) - (let (v312 u32) (add.checked v311 32)) - (let (v313 (ptr u8)) (inttoptr v312)) - (let (v314 u8) (load v313)) - (let (v315 i32) (zext v314)) - (let (v316 u32) (cast v315)) - (switchv316 - (0 . (block 41)) - (1 . (block 41)) - (2 . (block 40)) - (3 . (block 39 v315 v139 v161 v167 v170 v177 v183 v310)) - (_ . (block 39 v315 v139 v161 v167 v170 v177 v183 v310)))) + (let (v227 i32) (const.i32 8)) + (let (v228 i32) (band v222 v227)) + (let (v229 i1) (eq v228 0)) + (let (v230 i32) (zext v229)) + (let (v231 i1) (neq v230 0)) + (condbr v231 (block 28) (block 33))) (block 31 - (let (v233 u32) (bitcast v139)) - (let (v234 u32) (add.checked v233 16)) - (let (v235 u32) (mod.unchecked v234 4)) - (assertz 250 v235) - (let (v236 (ptr i32)) (inttoptr v234)) - (let (v237 i32) (load v236)) - (let (v238 i32) (const.i32 48)) - (let (v239 u32) (bitcast v139)) - (let (v240 u32) (add.checked v239 16)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (store v242 v238) - (let (v243 u32) (bitcast v139)) - (let (v244 u32) (add.checked v243 32)) - (let (v245 (ptr u8)) (inttoptr v244)) - (let (v246 u8) (load v245)) - (let (v247 i32) (zext v246)) - (let (v248 i32) (const.i32 1)) - (let (v249 i32) (const.i32 1)) - (let (v250 u32) (bitcast v249)) - (let (v251 u8) (trunc v250)) - (let (v252 u32) (bitcast v139)) - (let (v253 u32) (add.checked v252 32)) - (let (v254 (ptr u8)) (inttoptr v253)) - (store v254 v251) - (let (v255 u32) (bitcast v139)) - (let (v256 u32) (add.checked v255 20)) - (let (v257 u32) (mod.unchecked v256 4)) - (assertz 250 v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (let (v259 i32) (load v258)) - (let (v260 u32) (bitcast v139)) - (let (v261 u32) (add.checked v260 24)) - (let (v262 u32) (mod.unchecked v261 4)) - (assertz 250 v262) - (let (v263 (ptr i32)) (inttoptr v261)) - (let (v264 i32) (load v263)) - (let (v265 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v259 v264 v161 v167 v170)) - (let (v266 i1) (neq v265 0)) - (condbr v266 (block 23 v248) (block 32))) + (let (v207 u32) (bitcast v139)) + (let (v208 u32) (add.checked v207 20)) + (let (v209 u32) (mod.unchecked v208 4)) + (assertz 250 v209) + (let (v210 (ptr i32)) (inttoptr v208)) + (let (v211 i32) (load v210)) + (let (v212 u32) (bitcast v139)) + (let (v213 u32) (add.checked v212 24)) + (let (v214 u32) (mod.unchecked v213 4)) + (assertz 250 v214) + (let (v215 (ptr i32)) (inttoptr v213)) + (let (v216 i32) (load v215)) + (let (v217 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v211 v216 v160 v166 v169)) + (let (v218 i1) (eq v217 0)) + (let (v219 i32) (zext v218)) + (let (v220 i1) (neq v219 0)) + (condbr v220 (block 29) (block 32))) (block 32 - (let (v267 i32) (sub.wrapping v198 v199)) - (let (v268 i32) (const.i32 1)) - (let (v269 i32) (add.wrapping v267 v268)) - (br (block 34 v269 v259 v264 v177 v183 v139 v247 v237))) + (let (v221 i32) (const.i32 1)) + (ret v221)) (block 33 - (let (v288 i32) (const.i32 1)) - (let (v291 u32) (bitcast v278)) - (let (v292 u32) (add.checked v291 12)) - (let (v293 u32) (mod.unchecked v292 4)) - (assertz 250 v293) - (let (v294 (ptr i32)) (inttoptr v292)) - (let (v295 i32) (load v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 23 v288) (block 38))) + (let (v232 u32) (bitcast v139)) + (let (v233 u32) (add.checked v232 16)) + (let (v234 u32) (mod.unchecked v233 4)) + (assertz 250 v234) + (let (v235 (ptr i32)) (inttoptr v233)) + (let (v236 i32) (load v235)) + (let (v237 i32) (const.i32 48)) + (let (v238 u32) (bitcast v139)) + (let (v239 u32) (add.checked v238 16)) + (let (v240 u32) (mod.unchecked v239 4)) + (assertz 250 v240) + (let (v241 (ptr i32)) (inttoptr v239)) + (store v241 v237) + (let (v242 u32) (bitcast v139)) + (let (v243 u32) (add.checked v242 32)) + (let (v244 (ptr u8)) (inttoptr v243)) + (let (v245 u8) (load v244)) + (let (v246 i32) (zext v245)) + (let (v247 i32) (const.i32 1)) + (let (v248 i32) (const.i32 1)) + (let (v249 u32) (bitcast v248)) + (let (v250 u8) (trunc v249)) + (let (v251 u32) (bitcast v139)) + (let (v252 u32) (add.checked v251 32)) + (let (v253 (ptr u8)) (inttoptr v252)) + (store v253 v250) + (let (v254 u32) (bitcast v139)) + (let (v255 u32) (add.checked v254 20)) + (let (v256 u32) (mod.unchecked v255 4)) + (assertz 250 v256) + (let (v257 (ptr i32)) (inttoptr v255)) + (let (v258 i32) (load v257)) + (let (v259 u32) (bitcast v139)) + (let (v260 u32) (add.checked v259 24)) + (let (v261 u32) (mod.unchecked v260 4)) + (assertz 250 v261) + (let (v262 (ptr i32)) (inttoptr v260)) + (let (v263 i32) (load v262)) + (let (v264 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v258 v263 v160 v166 v169)) + (let (v265 i1) (neq v264 0)) + (condbr v265 (block 27 v247) (block 34))) (block 34 - (param v270 i32) - (param v276 i32) - (param v278 i32) - (param v289 i32) - (param v290 i32) - (param v297 i32) - (param v298 i32) - (param v304 i32) - (let (v271 i32) (const.i32 -1)) - (let (v272 i32) (add.wrapping v270 v271)) - (let (v273 i1) (eq v272 0)) - (let (v274 i32) (zext v273)) - (let (v275 i1) (neq v274 0)) - (condbr v275 (block 33) (block 36))) + (let (v266 i32) (sub.wrapping v200 v201)) + (let (v267 i32) (const.i32 1)) + (let (v268 i32) (add.wrapping v266 v267)) + (br (block 36 v268 v258 v263 v179 v185 v139 v246 v236))) (block 35 - (let (v287 i32) (const.i32 1)) - (ret v287)) + (let (v289 u32) (bitcast v277)) + (let (v290 u32) (add.checked v289 12)) + (let (v291 u32) (mod.unchecked v290 4)) + (assertz 250 v291) + (let (v292 (ptr i32)) (inttoptr v290)) + (let (v293 i32) (load v292)) + (let (v294 i1) (eq v293 0)) + (let (v295 i32) (zext v294)) + (let (v296 i1) (neq v295 0)) + (condbr v296 (block 40) (block 41))) (block 36 - (let (v277 i32) (const.i32 48)) - (let (v279 u32) (bitcast v278)) - (let (v280 u32) (add.checked v279 16)) - (let (v281 u32) (mod.unchecked v280 4)) - (assertz 250 v281) - (let (v282 (ptr i32)) (inttoptr v280)) - (let (v283 i32) (load v282)) - (let (v284 i1) (eq v283 0)) - (let (v285 i32) (zext v284)) - (let (v286 i1) (neq v285 0)) - (condbr v286 (block 34 v272 v276 v278 v289 v290 v297 v298 v304) (block 37))) + (param v269 i32) + (param v275 i32) + (param v277 i32) + (param v287 i32) + (param v288 i32) + (param v298 i32) + (param v299 i32) + (param v305 i32) + (let (v270 i32) (const.i32 -1)) + (let (v271 i32) (add.wrapping v269 v270)) + (let (v272 i1) (eq v271 0)) + (let (v273 i32) (zext v272)) + (let (v274 i1) (neq v273 0)) + (condbr v274 (block 35) (block 38))) (block 37 - (br (block 35))) + (let (v286 i32) (const.i32 1)) + (ret v286)) (block 38 - (let (v299 u32) (bitcast v298)) - (let (v300 u8) (trunc v299)) - (let (v301 u32) (bitcast v297)) - (let (v302 u32) (add.checked v301 32)) - (let (v303 (ptr u8)) (inttoptr v302)) - (store v303 v300) - (let (v305 u32) (bitcast v297)) - (let (v306 u32) (add.checked v305 16)) - (let (v307 u32) (mod.unchecked v306 4)) - (assertz 250 v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (store v308 v304) - (let (v309 i32) (const.i32 0)) - (br (block 23 v309))) + (let (v276 i32) (const.i32 48)) + (let (v278 u32) (bitcast v277)) + (let (v279 u32) (add.checked v278 16)) + (let (v280 u32) (mod.unchecked v279 4)) + (assertz 250 v280) + (let (v281 (ptr i32)) (inttoptr v279)) + (let (v282 i32) (load v281)) + (let (v283 i1) (eq v282 0)) + (let (v284 i32) (zext v283)) + (let (v285 i1) (neq v284 0)) + (condbr v285 (block 36 v271 v275 v277 v287 v288 v298 v299 v305) (block 39))) (block 39 - (param v330 i32) - (param v333 i32) - (param v369 i32) - (param v371 i32) - (param v373 i32) - (param v377 i32) - (param v379 i32) - (param v410 i32) - (let (v331 i32) (const.i32 1)) - (let (v332 i32) (add.wrapping v330 v331)) - (let (v334 u32) (bitcast v333)) - (let (v335 u32) (add.checked v334 16)) - (let (v336 u32) (mod.unchecked v335 4)) - (assertz 250 v336) - (let (v337 (ptr i32)) (inttoptr v335)) - (let (v338 i32) (load v337)) - (let (v339 u32) (bitcast v333)) - (let (v340 u32) (add.checked v339 24)) - (let (v341 u32) (mod.unchecked v340 4)) - (assertz 250 v341) - (let (v342 (ptr i32)) (inttoptr v340)) - (let (v343 i32) (load v342)) - (let (v344 u32) (bitcast v333)) - (let (v345 u32) (add.checked v344 20)) - (let (v346 u32) (mod.unchecked v345 4)) - (assertz 250 v346) - (let (v347 (ptr i32)) (inttoptr v345)) - (let (v348 i32) (load v347)) - (br (block 43 v332 v348 v338 v343 v369 v371 v373 v377 v379 v410))) + (br (block 37))) (block 40 - (let (v318 i32) (const.i32 1)) - (let (v319 u32) (bitcast v310)) - (let (v320 u32) (bitcast v318)) - (let (v321 u32) (shr.wrapping v319 v320)) - (let (v322 i32) (bitcast v321)) - (let (v323 i32) (const.i32 1)) - (let (v324 i32) (add.wrapping v310 v323)) - (let (v325 i32) (const.i32 1)) - (let (v326 u32) (bitcast v324)) - (let (v327 u32) (bitcast v325)) - (let (v328 u32) (shr.wrapping v326 v327)) - (let (v329 i32) (bitcast v328)) - (br (block 39 v322 v139 v161 v167 v170 v177 v183 v329))) + (let (v300 u32) (bitcast v299)) + (let (v301 u8) (trunc v300)) + (let (v302 u32) (bitcast v298)) + (let (v303 u32) (add.checked v302 32)) + (let (v304 (ptr u8)) (inttoptr v303)) + (store v304 v301) + (let (v306 u32) (bitcast v298)) + (let (v307 u32) (add.checked v306 16)) + (let (v308 u32) (mod.unchecked v307 4)) + (assertz 250 v308) + (let (v309 (ptr i32)) (inttoptr v307)) + (store v309 v305) + (let (v310 i32) (const.i32 0)) + (ret v310)) (block 41 - (let (v317 i32) (const.i32 0)) - (br (block 39 v310 v139 v161 v167 v170 v177 v183 v317))) + (let (v297 i32) (const.i32 1)) + (ret v297)) (block 42 - (let (v367 i32) (const.i32 1)) - (let (v374 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v355 v357 v368 v370 v372)) - (let (v375 i1) (neq v374 0)) - (condbr v375 (block 23 v367) (block 47))) + (param v336 i32) + (param v339 i32) + (param v375 i32) + (param v377 i32) + (param v379 i32) + (param v383 i32) + (param v385 i32) + (param v416 i32) + (let (v337 i32) (const.i32 1)) + (let (v338 i32) (add.wrapping v336 v337)) + (let (v340 u32) (bitcast v339)) + (let (v341 u32) (add.checked v340 16)) + (let (v342 u32) (mod.unchecked v341 4)) + (assertz 250 v342) + (let (v343 (ptr i32)) (inttoptr v341)) + (let (v344 i32) (load v343)) + (let (v345 u32) (bitcast v339)) + (let (v346 u32) (add.checked v345 24)) + (let (v347 u32) (mod.unchecked v346 4)) + (assertz 250 v347) + (let (v348 (ptr i32)) (inttoptr v346)) + (let (v349 i32) (load v348)) + (let (v350 u32) (bitcast v339)) + (let (v351 u32) (add.checked v350 20)) + (let (v352 u32) (mod.unchecked v351 4)) + (assertz 250 v352) + (let (v353 (ptr i32)) (inttoptr v351)) + (let (v354 i32) (load v353)) + (br (block 46 v338 v354 v344 v349 v375 v377 v379 v383 v385 v416))) (block 43 - (param v349 i32) - (param v355 i32) - (param v356 i32) - (param v357 i32) - (param v368 i32) - (param v370 i32) - (param v372 i32) - (param v376 i32) - (param v378 i32) - (param v409 i32) - (let (v350 i32) (const.i32 -1)) - (let (v351 i32) (add.wrapping v349 v350)) - (let (v352 i1) (eq v351 0)) - (let (v353 i32) (zext v352)) - (let (v354 i1) (neq v353 0)) - (condbr v354 (block 42) (block 45))) + (let (v324 i32) (const.i32 1)) + (let (v325 u32) (bitcast v316)) + (let (v326 u32) (bitcast v324)) + (let (v327 u32) (shr.wrapping v325 v326)) + (let (v328 i32) (bitcast v327)) + (let (v329 i32) (const.i32 1)) + (let (v330 i32) (add.wrapping v316 v329)) + (let (v331 i32) (const.i32 1)) + (let (v332 u32) (bitcast v330)) + (let (v333 u32) (bitcast v331)) + (let (v334 u32) (shr.wrapping v332 v333)) + (let (v335 i32) (bitcast v334)) + (br (block 42 v328 v139 v160 v166 v169 v179 v185 v335))) (block 44 - (let (v366 i32) (const.i32 1)) - (ret v366)) + (let (v323 i32) (const.i32 0)) + (br (block 42 v316 v139 v160 v166 v169 v179 v185 v323))) (block 45 - (let (v358 u32) (bitcast v357)) - (let (v359 u32) (add.checked v358 16)) - (let (v360 u32) (mod.unchecked v359 4)) - (assertz 250 v360) - (let (v361 (ptr i32)) (inttoptr v359)) - (let (v362 i32) (load v361)) - (let (v363 i1) (eq v362 0)) - (let (v364 i32) (zext v363)) - (let (v365 i1) (neq v364 0)) - (condbr v365 (block 43 v351 v355 v356 v357 v368 v370 v372 v376 v378 v409) (block 46))) + (let (v373 i32) (const.i32 1)) + (let (v380 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v361 v363 v374 v376 v378)) + (let (v381 i1) (neq v380 0)) + (condbr v381 (block 27 v373) (block 50))) (block 46 - (br (block 44))) + (param v355 i32) + (param v361 i32) + (param v362 i32) + (param v363 i32) + (param v374 i32) + (param v376 i32) + (param v378 i32) + (param v382 i32) + (param v384 i32) + (param v415 i32) + (let (v356 i32) (const.i32 -1)) + (let (v357 i32) (add.wrapping v355 v356)) + (let (v358 i1) (eq v357 0)) + (let (v359 i32) (zext v358)) + (let (v360 i1) (neq v359 0)) + (condbr v360 (block 45) (block 48))) (block 47 - (let (v380 u32) (bitcast v357)) - (let (v381 u32) (add.checked v380 12)) - (let (v382 u32) (mod.unchecked v381 4)) - (assertz 250 v382) - (let (v383 (ptr i32)) (inttoptr v381)) - (let (v384 i32) (load v383)) - (let (v385 i1) (neq v384 0)) - (condbr v385 (block 23 v367) (block 48))) + (let (v372 i32) (const.i32 1)) + (ret v372)) (block 48 - (let (v386 i32) (const.i32 0)) - (br (block 49 v409 v386 v355 v356 v357))) + (let (v364 u32) (bitcast v363)) + (let (v365 u32) (add.checked v364 16)) + (let (v366 u32) (mod.unchecked v365 4)) + (assertz 250 v366) + (let (v367 (ptr i32)) (inttoptr v365)) + (let (v368 i32) (load v367)) + (let (v369 i1) (eq v368 0)) + (let (v370 i32) (zext v369)) + (let (v371 i1) (neq v370 0)) + (condbr v371 (block 46 v357 v361 v362 v363 v374 v376 v378 v382 v384 v415) (block 49))) (block 49 - (param v387 i32) - (param v388 i32) - (param v398 i32) - (param v399 i32) - (param v400 i32) - (let (v389 i1) (neq v387 v388)) - (let (v390 i32) (zext v389)) - (let (v391 i1) (neq v390 0)) - (condbr v391 (block 51) (block 52))) + (br (block 47))) (block 50 - (let (v411 i32) (const.i32 -1)) - (let (v412 i32) (add.wrapping v397 v411)) - (let (v413 u32) (bitcast v412)) - (let (v414 u32) (bitcast v387)) - (let (v415 i1) (lt v413 v414)) - (let (v416 i32) (sext v415)) - (ret v416)) + (let (v386 u32) (bitcast v363)) + (let (v387 u32) (add.checked v386 12)) + (let (v388 u32) (mod.unchecked v387 4)) + (assertz 250 v388) + (let (v389 (ptr i32)) (inttoptr v387)) + (let (v390 i32) (load v389)) + (let (v391 i1) (neq v390 0)) + (condbr v391 (block 27 v373) (block 51))) (block 51 - (let (v396 i32) (const.i32 1)) - (let (v397 i32) (add.wrapping v388 v396)) - (let (v401 u32) (bitcast v400)) - (let (v402 u32) (add.checked v401 16)) - (let (v403 u32) (mod.unchecked v402 4)) - (assertz 250 v403) - (let (v404 (ptr i32)) (inttoptr v402)) - (let (v405 i32) (load v404)) - (let (v406 i1) (eq v405 0)) - (let (v407 i32) (zext v406)) - (let (v408 i1) (neq v407 0)) - (condbr v408 (block 49 v387 v397 v398 v399 v400) (block 53))) + (let (v392 i32) (const.i32 0)) + (br (block 52 v415 v392 v361 v362 v363))) (block 52 - (let (v392 u32) (bitcast v387)) - (let (v393 u32) (bitcast v387)) - (let (v394 i1) (lt v392 v393)) - (let (v395 i32) (sext v394)) - (ret v395)) + (param v393 i32) + (param v394 i32) + (param v404 i32) + (param v405 i32) + (param v406 i32) + (let (v395 i1) (neq v393 v394)) + (let (v396 i32) (zext v395)) + (let (v397 i1) (neq v396 0)) + (condbr v397 (block 54) (block 55))) (block 53 - (br (block 50))) + (let (v417 i32) (const.i32 -1)) + (let (v418 i32) (add.wrapping v403 v417)) + (let (v419 u32) (bitcast v418)) + (let (v420 u32) (bitcast v393)) + (let (v421 i1) (lt v419 v420)) + (let (v422 i32) (sext v421)) + (ret v422)) + + (block 54 + (let (v402 i32) (const.i32 1)) + (let (v403 i32) (add.wrapping v394 v402)) + (let (v407 u32) (bitcast v406)) + (let (v408 u32) (add.checked v407 16)) + (let (v409 u32) (mod.unchecked v408 4)) + (assertz 250 v409) + (let (v410 (ptr i32)) (inttoptr v408)) + (let (v411 i32) (load v410)) + (let (v412 i1) (eq v411 0)) + (let (v413 i32) (zext v412)) + (let (v414 i1) (neq v413 0)) + (condbr v414 (block 52 v393 v403 v404 v405 v406) (block 56))) + + (block 55 + (let (v398 u32) (bitcast v393)) + (let (v399 u32) (bitcast v393)) + (let (v400 i1) (lt v398 v399)) + (let (v401 i32) (sext v400)) + (ret v401)) + + (block 56 + (br (block 53))) ) (func (export #core::fmt::Write::write_fmt) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048928)) + (let (v3 i32) (const.i32 1048932)) (let (v4 i32) (call #core::fmt::write v0 v3 v1)) (br (block 1 v4))) @@ -5738,17 +5740,40 @@ (param v2 i32) (param v3 i32) (param v4 i32) - (let (v6 i32) (const.i32 0)) - (let (v7 i32) (const.i32 1114112)) - (let (v8 i1) (eq v2 v7)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 4 v3 v0 v4 v1) (block 5))) + (let (v6 i32) (const.i32 1114112)) + (let (v7 i1) (eq v2 v6)) + (let (v8 i32) (zext v7)) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2 v3 v0 v4 v1) (block 3))) (block 1 (param v5 i32) (ret v5)) (block 2 + (param v19 i32) + (param v22 i32) + (param v23 i32) + (param v24 i32) + (let (v20 i1) (neq v19 0)) + (condbr v20 (block 5) (block 6))) + + (block 3 + (let (v10 u32) (bitcast v1)) + (let (v11 u32) (add.checked v10 16)) + (let (v12 u32) (mod.unchecked v11 4)) + (assertz 250 v12) + (let (v13 (ptr i32)) (inttoptr v11)) + (let (v14 i32) (load v13)) + (let (v15 i1) (eq v14 0)) + (let (v16 i32) (zext v15)) + (let (v17 i1) (neq v16 0)) + (condbr v17 (block 2 v3 v0 v4 v1) (block 4))) + + (block 4 + (let (v18 i32) (const.i32 1)) + (ret v18)) + + (block 5 (let (v25 u32) (bitcast v24)) (let (v26 u32) (add.checked v25 12)) (let (v27 u32) (mod.unchecked v26 4)) @@ -5757,34 +5782,9 @@ (let (v29 i32) (load v28)) (br (block 1 v29))) - (block 3 (param v21 i32) - (ret v21)) - - (block 4 - (param v18 i32) - (param v22 i32) - (param v23 i32) - (param v24 i32) - (let (v19 i1) (neq v18 0)) - (condbr v19 (block 2) (block 7))) - - (block 5 - (let (v11 i32) (const.i32 1)) - (let (v12 u32) (bitcast v1)) - (let (v13 u32) (add.checked v12 16)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (let (v16 i32) (load v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 3 v11) (block 6))) - (block 6 - (br (block 4 v3 v0 v4 v1))) - - (block 7 - (let (v20 i32) (const.i32 0)) - (br (block 3 v20))) + (let (v21 i32) (const.i32 0)) + (ret v21)) ) (func (export #core::fmt::Formatter::debug_struct) @@ -5832,93 +5832,6 @@ (ret)) ) - (func (export #core::slice::index::slice_start_index_len_fail_rt) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 48)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 u32) (bitcast v7)) - (let (v10 u32) (add.checked v9 4)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (store v12 v1) - (let (v13 u32) (bitcast v7)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v7)) - (let (v18 u32) (add.checked v17 12)) - (let (v19 u32) (mod.unchecked v18 4)) - (assertz 250 v19) - (let (v20 (ptr i32)) (inttoptr v18)) - (store v20 v16) - (let (v21 i32) (const.i32 1049268)) - (let (v22 u32) (bitcast v7)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (store v25 v21) - (let (v26 i64) (const.i64 2)) - (let (v27 u32) (bitcast v7)) - (let (v28 u32) (add.checked v27 20)) - (let (v29 u32) (mod.unchecked v28 4)) - (assertz 250 v29) - (let (v30 (ptr i64)) (inttoptr v28)) - (store v30 v26) - (let (v31 i32) (const.i32 7)) - (let (v32 u32) (bitcast v31)) - (let (v33 u64) (zext v32)) - (let (v34 i64) (bitcast v33)) - (let (v35 i64) (const.i64 32)) - (let (v36 u32) (cast v35)) - (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 i32) (const.i32 4)) - (let (v39 i32) (add.wrapping v7 v38)) - (let (v40 u32) (bitcast v39)) - (let (v41 u64) (zext v40)) - (let (v42 i64) (bitcast v41)) - (let (v43 i64) (bor v37 v42)) - (let (v44 u32) (bitcast v7)) - (let (v45 u32) (add.checked v44 40)) - (let (v46 u32) (mod.unchecked v45 8)) - (assertz 250 v46) - (let (v47 (ptr i64)) (inttoptr v45)) - (store v47 v43) - (let (v48 u32) (bitcast v7)) - (let (v49 u64) (zext v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i64) (bor v37 v50)) - (let (v52 u32) (bitcast v7)) - (let (v53 u32) (add.checked v52 32)) - (let (v54 u32) (mod.unchecked v53 8)) - (assertz 250 v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v51) - (let (v56 i32) (const.i32 32)) - (let (v57 i32) (add.wrapping v7 v56)) - (let (v58 u32) (bitcast v7)) - (let (v59 u32) (add.checked v58 16)) - (let (v60 u32) (mod.unchecked v59 4)) - (assertz 250 v60) - (let (v61 (ptr i32)) (inttoptr v59)) - (store v61 v57) - (let (v62 i32) (const.i32 8)) - (let (v63 i32) (add.wrapping v7 v62)) - (call #core::panicking::panic_fmt v63 v2) - (unreachable)) - - (block 1) - ) - (func (export #core::fmt::num::imp::::fmt) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) @@ -5964,14 +5877,13 @@ (param v95 i32) (param v165 i32) (param v169 i32) - (let (v85 i32) (trunc v84)) - (let (v86 i32) (const.i32 99)) - (let (v87 u32) (bitcast v85)) - (let (v88 u32) (bitcast v86)) - (let (v89 i1) (lte v87 v88)) - (let (v90 i32) (sext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 8 v85 v92 v95 v165 v169) (block 9))) + (let (v85 i64) (const.i64 99)) + (let (v86 u64) (bitcast v84)) + (let (v87 u64) (bitcast v85)) + (let (v88 i1) (gt v86 v87)) + (let (v89 i32) (sext v88)) + (let (v90 i1) (neq v89 0)) + (condbr v90 (block 9) (block 10))) (block 3 (let (v18 i32) (const.i32 39)) @@ -6010,7 +5922,7 @@ (let (v43 i32) (const.i32 1)) (let (v44 u32) (bitcast v43)) (let (v45 i32) (shl.wrapping v42 v44)) - (let (v46 i32) (const.i32 1049014)) + (let (v46 i32) (const.i32 1049010)) (let (v47 i32) (add.wrapping v45 v46)) (let (v48 u32) (bitcast v47)) (let (v49 (ptr u16)) (inttoptr v48)) @@ -6031,7 +5943,7 @@ (let (v63 i32) (const.i32 1)) (let (v64 u32) (bitcast v63)) (let (v65 i32) (shl.wrapping v62 v64)) - (let (v66 i32) (const.i32 1049014)) + (let (v66 i32) (const.i32 1049010)) (let (v67 i32) (add.wrapping v65 v66)) (let (v68 u32) (bitcast v67)) (let (v69 (ptr u16)) (inttoptr v68)) @@ -6070,7 +5982,7 @@ (let (v129 i1) (lt v127 v128)) (let (v130 i32) (sext v129)) (let (v131 i1) (neq v130 0)) - (condbr v131 (block 11) (block 12))) + (condbr v131 (block 12) (block 13))) (block 9 (let (v93 i32) (const.i32 9)) @@ -6094,7 +6006,7 @@ (let (v112 i32) (const.i32 1)) (let (v113 u32) (bitcast v112)) (let (v114 i32) (shl.wrapping v111 v113)) - (let (v115 i32) (const.i32 1049014)) + (let (v115 i32) (const.i32 1049010)) (let (v116 i32) (add.wrapping v114 v115)) (let (v117 u32) (bitcast v116)) (let (v118 (ptr u16)) (inttoptr v117)) @@ -6108,6 +6020,10 @@ (br (block 8 v106 v92 v97 v165 v169))) (block 10 + (let (v91 i32) (trunc v84)) + (br (block 8 v91 v92 v95 v165 v169))) + + (block 11 (param v163 i32) (param v167 i32) (param v173 i32) @@ -6126,7 +6042,7 @@ (store v183 v182) (br (block 1 v180))) - (block 11 + (block 12 (let (v152 i32) (const.i32 9)) (let (v153 i32) (add.wrapping v132 v152)) (let (v154 i32) (const.i32 -1)) @@ -6139,9 +6055,9 @@ (let (v161 u32) (bitcast v156)) (let (v162 (ptr u8)) (inttoptr v161)) (store v162 v160) - (br (block 10 v164 v168 v132 v155))) + (br (block 11 v164 v168 v132 v155))) - (block 12 + (block 13 (let (v133 i32) (const.i32 9)) (let (v134 i32) (add.wrapping v132 v133)) (let (v136 i32) (const.i32 -2)) @@ -6150,7 +6066,7 @@ (let (v139 i32) (const.i32 1)) (let (v140 u32) (bitcast v139)) (let (v141 i32) (shl.wrapping v125 v140)) - (let (v142 i32) (const.i32 1049014)) + (let (v142 i32) (const.i32 1049010)) (let (v143 i32) (add.wrapping v141 v142)) (let (v144 u32) (bitcast v143)) (let (v145 (ptr u16)) (inttoptr v144)) @@ -6161,7 +6077,7 @@ (let (v150 u32) (bitcast v138)) (let (v151 (ptr u16)) (inttoptr v150)) (store v151 v149) - (br (block 10 v164 v168 v132 v137))) + (br (block 11 v164 v168 v132 v137))) ) (func (export #core::fmt::num::::fmt) @@ -6246,7 +6162,7 @@ (block 5 (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049012)) + (let (v66 i32) (const.i32 1049008)) (let (v67 i32) (const.i32 2)) (let (v68 i32) (add.wrapping v15 v40)) (let (v69 i32) (const.i32 128)) @@ -6262,7 +6178,7 @@ (block 6 (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048996)) + (let (v63 i32) (const.i32 1048992)) (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) (unreachable)) ) @@ -6349,7 +6265,7 @@ (block 5 (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049012)) + (let (v66 i32) (const.i32 1049008)) (let (v67 i32) (const.i32 2)) (let (v68 i32) (add.wrapping v15 v40)) (let (v69 i32) (const.i32 128)) @@ -6365,7 +6281,7 @@ (block 6 (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048996)) + (let (v63 i32) (const.i32 1048992)) (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) (unreachable)) ) @@ -6373,7 +6289,7 @@ (func (export #cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #cabi_realloc_wit_bindgen_0_28_0 v0 v1 v2 v3)) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) (br (block 1 v5))) (block 1 (param v4 i32) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat index 37807d4c4..2a2c61e42 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat @@ -88,13 +88,13 @@ i32.const 8 i32.add local.get 1 - i32.const 1048620 + i32.const 1048621 i32.const 9 call $core::fmt::Formatter::debug_struct local.get 2 i32.const 8 i32.add - i32.const 1048596 + i32.const 1048616 i32.const 5 local.get 0 i32.const 1048632 @@ -135,9 +135,7 @@ local.get 1 call $core::fmt::num::::fmt ) - (func $core::ptr::drop_in_place (;8;) (type 2) (param i32)) - (func $core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId> (;9;) (type 2) (param i32)) - (func $core::panicking::assert_failed (;10;) (type 7) (param i32 i32 i32) + (func $core::panicking::assert_failed (;8;) (type 7) (param i32 i32 i32) (local i32) global.get $__stack_pointer i32.const 16 @@ -160,16 +158,16 @@ i32.add i32.const 1048576 local.get 2 - i32.const 1048676 + i32.const 1048696 call $core::panicking::assert_failed_inner unreachable ) - (func $rust_begin_unwind (;11;) (type 2) (param i32) + (func $rust_begin_unwind (;9;) (type 2) (param i32) loop ;; label = @1 br 0 (;@1;) end ) - (func $::fmt (;12;) (type 1) (param i32 i32) (result i32) + (func $::fmt (;10;) (type 1) (param i32 i32) (result i32) (local i32) global.get $__stack_pointer i32.const 16 @@ -180,16 +178,16 @@ i32.const 8 i32.add local.get 1 - i32.const 1048592 + i32.const 1048596 i32.const 4 call $core::fmt::Formatter::debug_struct local.get 2 i32.const 8 i32.add - i32.const 1048596 + i32.const 1048616 i32.const 5 local.get 0 - i32.const 1048604 + i32.const 1048600 call $core::fmt::builders::DebugStruct::field call $core::fmt::builders::DebugStruct::finish local.set 1 @@ -199,16 +197,17 @@ global.set $__stack_pointer local.get 1 ) - (func $__rust_alloc (;13;) (type 1) (param i32 i32) (result i32) - i32.const 1049284 + (func $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports (;11;) (type 6)) + (func $__rust_alloc (;12;) (type 1) (param i32 i32) (result i32) + i32.const 1049280 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;14;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;13;) (type 8) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1049284 + i32.const 1049280 local.get 2 local.get 3 call $::alloc @@ -224,7 +223,7 @@ i32.lt_u select memory.copy - i32.const 1049284 + i32.const 1049280 local.get 0 local.get 2 local.get 1 @@ -232,7 +231,7 @@ end local.get 4 ) - (func $miden:base/note-script@1.0.0#note-script (;15;) (type 6) + (func $miden:base/note-script@1.0.0#note-script (;14;) (type 6) (local i32 i32 i32 i64 i64 i32 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -311,7 +310,7 @@ i32.ne br_if 0 (;@4;) end - i32.const 1049284 + i32.const 1049280 local.get 6 i32.const 8 local.get 5 @@ -319,7 +318,7 @@ i32.shl call $::dealloc end - i32.const 1049284 + i32.const 1049280 local.get 2 i32.const 8 local.get 1 @@ -334,7 +333,7 @@ end i32.const 0 i32.const 0 - i32.const 1048660 + i32.const 1048680 call $core::panicking::panic_bounds_check unreachable end @@ -353,54 +352,49 @@ call $core::panicking::assert_failed unreachable ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;16;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;15;) (type 8) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1049288 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) + local.get 3 + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1049284 + drop local.get 3 - call $__rust_realloc + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;17;) (type 6) + (func $wit_bindgen_rt::run_ctors_once (;16;) (type 6) block ;; label = @1 i32.const 0 - i32.load8_u offset=1049289 + i32.load8_u offset=1049285 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1049289 + i32.store8 offset=1049285 end ) - (func $wee_alloc::alloc_first_fit (;18;) (type 0) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;17;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -705,7 +699,7 @@ end i32.const 0 ) - (func $::alloc (;19;) (type 0) (param i32 i32 i32) (result i32) + (func $::alloc (;18;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -809,7 +803,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;20;) (type 9) (param i32 i32 i32 i32) + (func $::dealloc (;19;) (type 9) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -839,39 +833,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -952,18 +929,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -982,9 +969,7 @@ i32.store end ) - (func $core::ptr::drop_in_place (;21;) (type 2) (param i32)) - (func $core::ptr::drop_in_place (;22;) (type 2) (param i32)) - (func $core::panicking::panic_fmt (;23;) (type 10) (param i32 i32) + (func $core::panicking::panic_fmt (;20;) (type 10) (param i32 i32) (local i32) global.get $__stack_pointer i32.const 32 @@ -992,6 +977,22 @@ local.tee 2 global.set $__stack_pointer local.get 2 + i32.const 16 + i32.add + local.get 0 + i32.const 16 + i32.add + i64.load align=4 + i64.store + local.get 2 + i32.const 8 + i32.add + local.get 0 + i32.const 8 + i32.add + i64.load align=4 + i64.store + local.get 2 i32.const 1 i32.store16 offset=28 local.get 2 @@ -999,27 +1000,65 @@ i32.store offset=24 local.get 2 local.get 0 - i32.store offset=20 - local.get 2 - i32.const 1048696 - i32.store offset=16 - local.get 2 - i32.const 1 - i32.store offset=12 + i64.load align=4 + i64.store local.get 2 - i32.const 12 - i32.add call $rust_begin_unwind unreachable ) - (func $core::slice::index::slice_start_index_len_fail (;24;) (type 7) (param i32 i32 i32) + (func $core::slice::index::slice_start_index_len_fail (;21;) (type 7) (param i32 i32 i32) + (local i32 i64) + global.get $__stack_pointer + i32.const 48 + i32.sub + local.tee 3 + global.set $__stack_pointer + local.get 3 local.get 0 + i32.store + local.get 3 local.get 1 + i32.store offset=4 + local.get 3 + i32.const 2 + i32.store offset=12 + local.get 3 + i32.const 1049264 + i32.store offset=8 + local.get 3 + i64.const 2 + i64.store offset=20 align=4 + local.get 3 + i32.const 6 + i64.extend_i32_u + i64.const 32 + i64.shl + local.tee 4 + local.get 3 + i32.const 4 + i32.add + i64.extend_i32_u + i64.or + i64.store offset=40 + local.get 3 + local.get 4 + local.get 3 + i64.extend_i32_u + i64.or + i64.store offset=32 + local.get 3 + local.get 3 + i32.const 32 + i32.add + i32.store offset=16 + local.get 3 + i32.const 8 + i32.add local.get 2 - call $core::slice::index::slice_start_index_len_fail_rt + call $core::panicking::panic_fmt unreachable ) - (func $core::panicking::panic_bounds_check (;25;) (type 7) (param i32 i32 i32) + (func $core::panicking::panic_bounds_check (;22;) (type 7) (param i32 i32 i32) (local i32 i64) global.get $__stack_pointer i32.const 48 @@ -1036,13 +1075,13 @@ i32.const 2 i32.store offset=12 local.get 3 - i32.const 1048764 + i32.const 1048768 i32.store offset=8 local.get 3 i64.const 2 i64.store offset=20 align=4 local.get 3 - i32.const 7 + i32.const 6 i64.extend_i32_u i64.const 32 i64.shl @@ -1071,20 +1110,27 @@ call $core::panicking::panic_fmt unreachable ) - (func $core::fmt::Formatter::pad (;26;) (type 0) (param i32 i32 i32) (result i32) + (func $core::fmt::Formatter::pad (;23;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32) + local.get 0 + i32.load offset=8 + local.set 3 block ;; label = @1 - local.get 0 - i32.load - local.tee 3 - local.get 0 - i32.load offset=8 - local.tee 4 - i32.or - i32.eqz - br_if 0 (;@1;) block ;; label = @2 - local.get 4 + local.get 0 + i32.load + local.tee 4 + br_if 0 (;@2;) + local.get 3 + i32.const 1 + i32.and + i32.eqz + br_if 1 (;@1;) + end + block ;; label = @2 + local.get 3 + i32.const 1 + i32.and i32.eqz br_if 0 (;@2;) local.get 1 @@ -1109,19 +1155,19 @@ local.set 8 loop ;; label = @4 local.get 8 - local.tee 4 + local.tee 3 local.get 5 i32.eq br_if 2 (;@2;) block ;; label = @5 block ;; label = @6 - local.get 4 + local.get 3 i32.load8_s local.tee 8 i32.const -1 i32.le_s br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 1 i32.add local.set 8 @@ -1132,7 +1178,7 @@ i32.const -32 i32.ge_u br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 2 i32.add local.set 8 @@ -1143,50 +1189,21 @@ i32.const -16 i32.ge_u br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 3 i32.add local.set 8 br 1 (;@5;) end - local.get 4 - i32.load8_u offset=2 - i32.const 63 - i32.and - i32.const 6 - i32.shl - local.get 4 - i32.load8_u offset=1 - i32.const 63 - i32.and - i32.const 12 - i32.shl - i32.or - local.get 4 - i32.load8_u offset=3 - i32.const 63 - i32.and - i32.or - local.get 8 - i32.const 255 - i32.and - i32.const 18 - i32.shl - i32.const 1835008 - i32.and - i32.or - i32.const 1114112 - i32.eq - br_if 3 (;@2;) - local.get 4 + local.get 3 i32.const 4 i32.add local.set 8 end - local.get 7 - local.get 4 - i32.sub local.get 8 + local.get 3 + i32.sub + local.get 7 i32.add local.set 7 local.get 6 @@ -1203,76 +1220,60 @@ block ;; label = @3 local.get 8 i32.load8_s - local.tee 4 + local.tee 3 i32.const -1 i32.gt_s br_if 0 (;@3;) - local.get 4 + local.get 3 i32.const -32 i32.lt_u - br_if 0 (;@3;) - local.get 4 - i32.const -16 - i32.lt_u - br_if 0 (;@3;) - local.get 8 - i32.load8_u offset=2 - i32.const 63 - i32.and - i32.const 6 - i32.shl - local.get 8 - i32.load8_u offset=1 - i32.const 63 - i32.and - i32.const 12 - i32.shl - i32.or - local.get 8 - i32.load8_u offset=3 - i32.const 63 - i32.and - i32.or - local.get 4 - i32.const 255 - i32.and - i32.const 18 - i32.shl - i32.const 1835008 - i32.and - i32.or - i32.const 1114112 - i32.eq - br_if 1 (;@2;) + drop end block ;; label = @3 - local.get 7 - i32.eqz - br_if 0 (;@3;) block ;; label = @4 local.get 7 - local.get 2 - i32.lt_u + i32.eqz br_if 0 (;@4;) - local.get 7 - local.get 2 - i32.eq - br_if 1 (;@3;) - br 2 (;@2;) + block ;; label = @5 + local.get 7 + local.get 2 + i32.ge_u + br_if 0 (;@5;) + local.get 1 + local.get 7 + i32.add + i32.load8_s + i32.const -65 + i32.gt_s + br_if 1 (;@4;) + i32.const 0 + local.set 3 + br 2 (;@3;) + end + local.get 7 + local.get 2 + i32.eq + br_if 0 (;@4;) + i32.const 0 + local.set 3 + br 1 (;@3;) end local.get 1 - local.get 7 - i32.add - i32.load8_s - i32.const -64 - i32.lt_s - br_if 1 (;@2;) + local.set 3 end local.get 7 + local.get 2 + local.get 3 + select local.set 2 + local.get 3 + local.get 1 + local.get 3 + select + local.set 1 end block ;; label = @2 - local.get 3 + local.get 4 br_if 0 (;@2;) local.get 0 i32.load offset=20 @@ -1286,7 +1287,7 @@ end local.get 0 i32.load offset=4 - local.set 3 + local.set 4 block ;; label = @2 block ;; label = @3 local.get 2 @@ -1296,14 +1297,14 @@ local.get 1 local.get 2 call $core::str::count::do_count_chars - local.set 4 + local.set 3 br 1 (;@2;) end block ;; label = @3 local.get 2 br_if 0 (;@3;) i32.const 0 - local.set 4 + local.set 3 br 1 (;@2;) end local.get 2 @@ -1317,7 +1318,7 @@ i32.ge_u br_if 0 (;@4;) i32.const 0 - local.set 4 + local.set 3 i32.const 0 local.set 7 br 1 (;@3;) @@ -1327,11 +1328,11 @@ i32.and local.set 5 i32.const 0 - local.set 4 + local.set 3 i32.const 0 local.set 7 loop ;; label = @4 - local.get 4 + local.get 3 local.get 1 local.get 7 i32.add @@ -1361,7 +1362,7 @@ i32.const -65 i32.gt_s i32.add - local.set 4 + local.set 3 local.get 5 local.get 7 i32.const 4 @@ -1379,13 +1380,13 @@ i32.add local.set 8 loop ;; label = @3 - local.get 4 + local.get 3 local.get 8 i32.load8_s i32.const -65 i32.gt_s i32.add - local.set 4 + local.set 3 local.get 8 i32.const 1 i32.add @@ -1399,16 +1400,16 @@ end block ;; label = @2 block ;; label = @3 - local.get 3 local.get 4 + local.get 3 i32.le_u br_if 0 (;@3;) - local.get 3 local.get 4 + local.get 3 i32.sub local.set 5 i32.const 0 - local.set 4 + local.set 3 block ;; label = @4 block ;; label = @5 block ;; label = @6 @@ -1417,7 +1418,7 @@ br_table 2 (;@4;) 0 (;@6;) 1 (;@5;) 2 (;@4;) 2 (;@4;) end local.get 5 - local.set 4 + local.set 3 i32.const 0 local.set 5 br 1 (;@4;) @@ -1425,7 +1426,7 @@ local.get 5 i32.const 1 i32.shr_u - local.set 4 + local.set 3 local.get 5 i32.const 1 i32.add @@ -1433,10 +1434,10 @@ i32.shr_u local.set 5 end - local.get 4 + local.get 3 i32.const 1 i32.add - local.set 4 + local.set 3 local.get 0 i32.load offset=16 local.set 6 @@ -1447,10 +1448,10 @@ i32.load offset=20 local.set 7 loop ;; label = @4 - local.get 4 + local.get 3 i32.const -1 i32.add - local.tee 4 + local.tee 3 i32.eqz br_if 2 (;@2;) local.get 7 @@ -1474,8 +1475,6 @@ call_indirect (type 0) return end - i32.const 1 - local.set 4 block ;; label = @2 local.get 7 local.get 1 @@ -1483,43 +1482,41 @@ local.get 8 i32.load offset=12 call_indirect (type 0) + i32.eqz br_if 0 (;@2;) - i32.const 0 - local.set 4 + i32.const 1 + return + end + i32.const 0 + local.set 3 + loop ;; label = @2 block ;; label = @3 - loop ;; label = @4 - block ;; label = @5 - local.get 5 - local.get 4 - i32.ne - br_if 0 (;@5;) - local.get 5 - local.set 4 - br 2 (;@3;) - end - local.get 4 - i32.const 1 - i32.add - local.set 4 - local.get 7 - local.get 6 - local.get 8 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@4;) - end - local.get 4 - i32.const -1 - i32.add - local.set 4 + local.get 5 + local.get 3 + i32.ne + br_if 0 (;@3;) + local.get 5 + local.get 5 + i32.lt_u + return end - local.get 4 - local.get 5 - i32.lt_u - local.set 4 + local.get 3 + i32.const 1 + i32.add + local.set 3 + local.get 7 + local.get 6 + local.get 8 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@2;) end - local.get 4 + local.get 3 + i32.const -1 + i32.add + local.get 5 + i32.lt_u return end local.get 0 @@ -1531,14 +1528,14 @@ i32.load offset=12 call_indirect (type 0) ) - (func $core::fmt::num::imp::::fmt (;27;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::imp::::fmt (;24;) (type 1) (param i32 i32) (result i32) local.get 0 i64.load32_u i32.const 1 local.get 1 call $core::fmt::num::imp::fmt_u64 ) - (func $core::fmt::write (;28;) (type 0) (param i32 i32 i32) (result i32) + (func $core::fmt::write (;25;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -1856,15 +1853,7 @@ global.set $__stack_pointer local.get 1 ) - (func $::type_id (;29;) (type 10) (param i32 i32) - local.get 0 - i64.const 5799598635382251841 - i64.store offset=8 - local.get 0 - i64.const 3885382061309546557 - i64.store - ) - (func $core::fmt::builders::DebugStruct::field (;30;) (type 11) (param i32 i32 i32 i32 i32) (result i32) + (func $core::fmt::builders::DebugStruct::field (;26;) (type 11) (param i32 i32 i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i64) global.get $__stack_pointer i32.const 64 @@ -1893,10 +1882,10 @@ local.set 6 local.get 8 i32.load offset=20 - i32.const 1048959 - i32.const 1048956 + i32.const 1048963 + i32.const 1048960 local.get 7 - i32.const 255 + i32.const 1 i32.and local.tee 7 select @@ -1909,8 +1898,6 @@ i32.load offset=12 call_indirect (type 0) br_if 1 (;@1;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 local.get 1 @@ -1920,11 +1907,9 @@ i32.load offset=12 call_indirect (type 0) br_if 1 (;@1;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 - i32.const 1048924 + i32.const 1048928 i32.const 2 local.get 8 i32.load offset=24 @@ -1939,16 +1924,16 @@ local.set 6 br 1 (;@1;) end + i32.const 1 + local.set 6 block ;; label = @2 local.get 7 - i32.const 255 + i32.const 1 i32.and br_if 0 (;@2;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 - i32.const 1048961 + i32.const 1048965 i32.const 3 local.get 8 i32.load offset=24 @@ -1969,7 +1954,7 @@ i64.load offset=20 align=4 i64.store offset=12 align=4 local.get 5 - i32.const 1048928 + i32.const 1048932 i32.store offset=52 local.get 5 local.get 5 @@ -2012,7 +1997,7 @@ local.get 5 i32.const 12 i32.add - i32.const 1048924 + i32.const 1048928 i32.const 2 call $::write_str br_if 0 (;@1;) @@ -2026,7 +2011,7 @@ br_if 0 (;@1;) local.get 5 i32.load offset=48 - i32.const 1048964 + i32.const 1048968 i32.const 2 local.get 5 i32.load offset=52 @@ -2046,7 +2031,7 @@ global.set $__stack_pointer local.get 0 ) - (func $<&T as core::fmt::Display>::fmt (;31;) (type 1) (param i32 i32) (result i32) + (func $<&T as core::fmt::Display>::fmt (;27;) (type 1) (param i32 i32) (result i32) local.get 1 local.get 0 i32.load @@ -2054,7 +2039,7 @@ i32.load offset=4 call $core::fmt::Formatter::pad ) - (func $core::panicking::assert_failed_inner (;32;) (type 12) (param i32 i32 i32 i32 i32 i32 i32) + (func $core::panicking::assert_failed_inner (;28;) (type 12) (param i32 i32 i32 i32 i32 i32 i32) (local i32 i64) global.get $__stack_pointer i32.const 112 @@ -2083,21 +2068,21 @@ br_table 0 (;@4;) 1 (;@3;) 2 (;@2;) 0 (;@4;) end local.get 7 - i32.const 1048780 + i32.const 1048784 i32.store offset=24 i32.const 2 local.set 2 br 2 (;@1;) end local.get 7 - i32.const 1048782 + i32.const 1048786 i32.store offset=24 i32.const 2 local.set 2 br 1 (;@1;) end local.get 7 - i32.const 1048784 + i32.const 1048788 i32.store offset=24 i32.const 7 local.set 2 @@ -2113,13 +2098,13 @@ i32.const 3 i32.store offset=92 local.get 7 - i32.const 1048840 + i32.const 1048844 i32.store offset=88 local.get 7 i64.const 3 i64.store offset=100 align=4 local.get 7 - i32.const 8 + i32.const 7 i64.extend_i32_u i64.const 32 i64.shl @@ -2139,7 +2124,7 @@ i64.or i64.store offset=64 local.get 7 - i32.const 9 + i32.const 8 i64.extend_i32_u i64.const 32 i64.shl @@ -2189,13 +2174,13 @@ i32.const 4 i32.store offset=92 local.get 7 - i32.const 1048892 + i32.const 1048896 i32.store offset=88 local.get 7 i64.const 4 i64.store offset=100 align=4 local.get 7 - i32.const 8 + i32.const 7 i64.extend_i32_u i64.const 32 i64.shl @@ -2215,7 +2200,7 @@ i64.or i64.store offset=72 local.get 7 - i32.const 10 + i32.const 9 i64.extend_i32_u i64.const 32 i64.shl @@ -2226,7 +2211,7 @@ i64.or i64.store offset=64 local.get 7 - i32.const 9 + i32.const 8 i64.extend_i32_u i64.const 32 i64.shl @@ -2248,7 +2233,7 @@ call $core::panicking::panic_fmt unreachable ) - (func $<&T as core::fmt::Debug>::fmt (;33;) (type 1) (param i32 i32) (result i32) + (func $<&T as core::fmt::Debug>::fmt (;29;) (type 1) (param i32 i32) (result i32) local.get 0 i32.load local.get 1 @@ -2257,7 +2242,7 @@ i32.load offset=12 call_indirect (type 1) ) - (func $::fmt (;34;) (type 1) (param i32 i32) (result i32) + (func $::fmt (;30;) (type 1) (param i32 i32) (result i32) local.get 1 i32.load offset=20 local.get 1 @@ -2265,8 +2250,8 @@ local.get 0 call $core::fmt::write ) - (func $::write_str (;35;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) + (func $::write_str (;31;) (type 0) (param i32 i32 i32) (result i32) + (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) local.get 1 i32.const -1 i32.add @@ -2284,286 +2269,288 @@ local.set 7 i32.const 0 local.set 8 - loop ;; label = @1 - block ;; label = @2 + i32.const 0 + local.set 9 + i32.const 0 + local.set 10 + block ;; label = @1 + loop ;; label = @2 + local.get 10 + i32.const 1 + i32.and + br_if 1 (;@1;) block ;; label = @3 - local.get 7 - local.get 2 - i32.gt_u - br_if 0 (;@3;) - loop ;; label = @4 - local.get 1 - local.get 7 - i32.add - local.set 9 - block ;; label = @5 + block ;; label = @4 + local.get 9 + local.get 2 + i32.gt_u + br_if 0 (;@4;) + loop ;; label = @5 + local.get 1 + local.get 9 + i32.add + local.set 11 block ;; label = @6 block ;; label = @7 - local.get 2 - local.get 7 - i32.sub - local.tee 10 - i32.const 8 - i32.lt_u - br_if 0 (;@7;) block ;; label = @8 block ;; label = @9 - local.get 9 - i32.const 3 - i32.add - i32.const -4 - i32.and - local.tee 11 + local.get 2 local.get 9 i32.sub local.tee 12 - i32.eqz + i32.const 7 + i32.gt_u br_if 0 (;@9;) - i32.const 0 - local.set 0 - loop ;; label = @10 - local.get 9 - local.get 0 + local.get 2 + local.get 9 + i32.ne + br_if 1 (;@8;) + local.get 2 + local.set 9 + br 5 (;@4;) + end + block ;; label = @9 + block ;; label = @10 + local.get 11 + i32.const 3 i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 5 (;@5;) + i32.const -4 + i32.and + local.tee 13 + local.get 11 + i32.sub + local.tee 14 + i32.eqz + br_if 0 (;@10;) + i32.const 0 + local.set 0 + loop ;; label = @11 + local.get 11 + local.get 0 + i32.add + i32.load8_u + i32.const 10 + i32.eq + br_if 5 (;@6;) + local.get 14 + local.get 0 + i32.const 1 + i32.add + local.tee 0 + i32.ne + br_if 0 (;@11;) + end + local.get 14 local.get 12 - local.get 0 - i32.const 1 + i32.const -8 i32.add - local.tee 0 - i32.ne - br_if 0 (;@10;) + local.tee 15 + i32.le_u + br_if 1 (;@9;) + br 3 (;@7;) end local.get 12 - local.get 10 i32.const -8 i32.add - local.tee 13 + local.set 15 + end + loop ;; label = @9 + i32.const 16843008 + local.get 13 + i32.load + local.tee 0 + i32.const 168430090 + i32.xor + i32.sub + local.get 0 + i32.or + i32.const 16843008 + local.get 13 + i32.const 4 + i32.add + i32.load + local.tee 0 + i32.const 168430090 + i32.xor + i32.sub + local.get 0 + i32.or + i32.and + i32.const -2139062144 + i32.and + i32.const -2139062144 + i32.ne + br_if 2 (;@7;) + local.get 13 + i32.const 8 + i32.add + local.set 13 + local.get 14 + i32.const 8 + i32.add + local.tee 14 + local.get 15 i32.le_u - br_if 1 (;@8;) - br 3 (;@6;) + br_if 0 (;@9;) + br 2 (;@7;) end - local.get 10 - i32.const -8 - i32.add - local.set 13 end + i32.const 0 + local.set 0 loop ;; label = @8 local.get 11 - i32.const 4 - i32.add - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.const -16843009 - i32.add local.get 0 - i32.const -1 - i32.xor - i32.and - local.get 11 - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.const -16843009 i32.add - local.get 0 - i32.const -1 - i32.xor - i32.and - i32.or - i32.const -2139062144 - i32.and + i32.load8_u + i32.const 10 + i32.eq br_if 2 (;@6;) - local.get 11 - i32.const 8 - i32.add - local.set 11 local.get 12 - i32.const 8 + local.get 0 + i32.const 1 i32.add - local.tee 12 - local.get 13 - i32.le_u + local.tee 0 + i32.ne br_if 0 (;@8;) - br 2 (;@6;) end + local.get 2 + local.set 9 + br 3 (;@4;) end block ;; label = @7 - local.get 2 - local.get 7 + local.get 14 + local.get 12 i32.ne br_if 0 (;@7;) local.get 2 - local.set 7 - br 4 (;@3;) + local.set 9 + br 3 (;@4;) end - i32.const 0 - local.set 0 loop ;; label = @7 - local.get 9 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 2 (;@5;) - local.get 10 - local.get 0 + block ;; label = @8 + local.get 11 + local.get 14 + i32.add + i32.load8_u + i32.const 10 + i32.ne + br_if 0 (;@8;) + local.get 14 + local.set 0 + br 2 (;@6;) + end + local.get 12 + local.get 14 i32.const 1 i32.add - local.tee 0 + local.tee 14 i32.ne br_if 0 (;@7;) end local.get 2 - local.set 7 - br 3 (;@3;) + local.set 9 + br 2 (;@4;) end - block ;; label = @6 - local.get 10 - local.get 12 - i32.ne - br_if 0 (;@6;) - local.get 2 - local.set 7 - br 3 (;@3;) - end - loop ;; label = @6 - block ;; label = @7 - local.get 9 - local.get 12 - i32.add - i32.load8_u - i32.const 10 - i32.ne - br_if 0 (;@7;) - local.get 12 - local.set 0 - br 2 (;@5;) - end - local.get 10 - local.get 12 - i32.const 1 + local.get 0 + local.get 9 + i32.add + local.tee 14 + i32.const 1 + i32.add + local.set 9 + block ;; label = @6 + local.get 14 + local.get 2 + i32.ge_u + br_if 0 (;@6;) + local.get 11 + local.get 0 i32.add - local.tee 12 + i32.load8_u + i32.const 10 i32.ne br_if 0 (;@6;) + local.get 9 + local.set 11 + local.get 9 + local.set 0 + br 3 (;@3;) end - local.get 2 - local.set 7 - br 2 (;@3;) - end - local.get 0 - local.get 7 - i32.add - local.tee 12 - i32.const 1 - i32.add - local.set 7 - block ;; label = @5 - local.get 12 - local.get 2 - i32.ge_u - br_if 0 (;@5;) local.get 9 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.ne + local.get 2 + i32.le_u br_if 0 (;@5;) - i32.const 0 - local.set 9 - local.get 7 - local.set 11 - local.get 7 - local.set 0 - br 3 (;@2;) end - local.get 7 - local.get 2 - i32.le_u + end + i32.const 1 + local.set 10 + local.get 8 + local.set 11 + local.get 2 + local.set 0 + local.get 8 + local.get 2 + i32.eq + br_if 2 (;@1;) + end + block ;; label = @3 + block ;; label = @4 + local.get 6 + i32.load8_u + i32.eqz br_if 0 (;@4;) + local.get 5 + i32.const 1048956 + i32.const 4 + local.get 4 + i32.load offset=12 + call_indirect (type 0) + br_if 1 (;@3;) end + local.get 0 + local.get 8 + i32.sub + local.set 13 + i32.const 0 + local.set 14 + block ;; label = @4 + local.get 0 + local.get 8 + i32.eq + br_if 0 (;@4;) + local.get 3 + local.get 0 + i32.add + i32.load8_u + i32.const 10 + i32.eq + local.set 14 + end + local.get 1 + local.get 8 + i32.add + local.set 0 + local.get 6 + local.get 14 + i32.store8 + local.get 11 + local.set 8 + local.get 5 + local.get 0 + local.get 13 + local.get 4 + i32.load offset=12 + call_indirect (type 0) + i32.eqz + br_if 1 (;@2;) end - i32.const 1 - local.set 9 - local.get 8 - local.set 11 - local.get 2 - local.set 0 - local.get 8 - local.get 2 - i32.ne - br_if 0 (;@2;) - i32.const 0 - return - end - block ;; label = @2 - local.get 6 - i32.load8_u - i32.eqz - br_if 0 (;@2;) - local.get 5 - i32.const 1048952 - i32.const 4 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 0 (;@2;) - i32.const 1 - return - end - local.get 0 - local.get 8 - i32.sub - local.set 10 - i32.const 0 - local.set 12 - block ;; label = @2 - local.get 0 - local.get 8 - i32.eq - br_if 0 (;@2;) - local.get 3 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - local.set 12 end - local.get 1 - local.get 8 - i32.add - local.set 0 - local.get 6 - local.get 12 - i32.store8 - local.get 11 - local.set 8 - local.get 5 - local.get 0 - local.get 10 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - local.tee 0 - local.get 9 - i32.or - i32.eqz - br_if 0 (;@1;) + i32.const 1 + local.set 7 end - local.get 0 + local.get 7 ) - (func $::write_char (;36;) (type 1) (param i32 i32) (result i32) + (func $::write_char (;32;) (type 1) (param i32 i32) (result i32) (local i32 i32) local.get 0 i32.load offset=4 @@ -2579,7 +2566,7 @@ i32.eqz br_if 0 (;@1;) local.get 3 - i32.const 1048952 + i32.const 1048956 i32.const 4 local.get 2 i32.load offset=12 @@ -2600,67 +2587,62 @@ i32.load offset=16 call_indirect (type 1) ) - (func $core::fmt::builders::DebugStruct::finish (;37;) (type 13) (param i32) (result i32) + (func $core::fmt::builders::DebugStruct::finish (;33;) (type 13) (param i32) (result i32) (local i32 i32) local.get 0 i32.load8_u offset=4 - local.set 1 + local.tee 1 + local.set 2 block ;; label = @1 local.get 0 i32.load8_u offset=5 + i32.eqz br_if 0 (;@1;) - local.get 1 - i32.const 255 - i32.and - i32.const 0 - i32.ne - return - end - i32.const 1 - local.set 2 - block ;; label = @1 - local.get 1 - i32.const 255 - i32.and - br_if 0 (;@1;) + i32.const 1 + local.set 2 block ;; label = @2 - local.get 0 - i32.load - local.tee 1 - i32.load8_u offset=28 - i32.const 4 + local.get 1 + i32.const 1 i32.and br_if 0 (;@2;) - local.get 0 - local.get 1 + block ;; label = @3 + local.get 0 + i32.load + local.tee 2 + i32.load8_u offset=28 + i32.const 4 + i32.and + br_if 0 (;@3;) + local.get 2 + i32.load offset=20 + i32.const 1048971 + i32.const 2 + local.get 2 + i32.load offset=24 + i32.load offset=12 + call_indirect (type 0) + local.set 2 + br 1 (;@2;) + end + local.get 2 i32.load offset=20 - i32.const 1048967 - i32.const 2 - local.get 1 + i32.const 1048970 + i32.const 1 + local.get 2 i32.load offset=24 i32.load offset=12 call_indirect (type 0) - local.tee 1 - i32.store8 offset=4 - local.get 1 - return + local.set 2 end - local.get 1 - i32.load offset=20 - i32.const 1048966 - i32.const 1 - local.get 1 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - local.set 2 + local.get 0 + local.get 2 + i32.store8 offset=4 end - local.get 0 - local.get 2 - i32.store8 offset=4 local.get 2 + i32.const 1 + i32.and ) - (func $core::fmt::Formatter::pad_integral (;38;) (type 14) (param i32 i32 i32 i32 i32 i32) (result i32) + (func $core::fmt::Formatter::pad_integral (;34;) (type 14) (param i32 i32 i32 i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 block ;; label = @2 @@ -2818,135 +2800,144 @@ local.set 6 end block ;; label = @1 + local.get 0 + i32.load + br_if 0 (;@1;) block ;; label = @2 - local.get 0 - i32.load - br_if 0 (;@2;) - i32.const 1 - local.set 1 - local.get 0 - i32.load offset=20 - local.tee 12 - local.get 0 - i32.load offset=24 - local.tee 10 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 12 - local.get 4 - local.get 5 - local.get 10 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @2 - local.get 0 - i32.load offset=4 - local.tee 9 - local.get 6 - i32.gt_u - br_if 0 (;@2;) - i32.const 1 - local.set 1 local.get 0 i32.load offset=20 - local.tee 12 + local.tee 1 local.get 0 i32.load offset=24 - local.tee 10 + local.tee 12 local.get 8 local.get 2 local.get 3 call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 12 - local.get 4 - local.get 5 - local.get 10 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @2 - local.get 7 - i32.const 8 - i32.and i32.eqz br_if 0 (;@2;) - local.get 0 - i32.load offset=16 - local.set 11 - local.get 0 - i32.const 48 - i32.store offset=16 - local.get 0 - i32.load8_u offset=32 - local.set 7 - i32.const 1 - local.set 1 - local.get 0 i32.const 1 - i32.store8 offset=32 - local.get 0 - i32.load offset=20 - local.tee 12 - local.get 0 - i32.load offset=24 - local.tee 10 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 9 - local.get 6 - i32.sub - i32.const 1 - i32.add - local.set 1 + return + end + local.get 1 + local.get 4 + local.get 5 + local.get 12 + i32.load offset=12 + call_indirect (type 0) + return + end + block ;; label = @1 + block ;; label = @2 block ;; label = @3 - loop ;; label = @4 - local.get 1 - i32.const -1 - i32.add + block ;; label = @4 + local.get 0 + i32.load offset=4 + local.tee 1 + local.get 6 + i32.gt_u + br_if 0 (;@4;) + local.get 0 + i32.load offset=20 local.tee 1 + local.get 0 + i32.load offset=24 + local.tee 12 + local.get 8 + local.get 2 + local.get 3 + call $core::fmt::Formatter::pad_integral::write_prefix i32.eqz br_if 1 (;@3;) + i32.const 1 + return + end + local.get 7 + i32.const 8 + i32.and + i32.eqz + br_if 1 (;@2;) + local.get 0 + i32.load offset=16 + local.set 9 + local.get 0 + i32.const 48 + i32.store offset=16 + local.get 0 + i32.load8_u offset=32 + local.set 7 + i32.const 1 + local.set 11 + local.get 0 + i32.const 1 + i32.store8 offset=32 + local.get 0 + i32.load offset=20 + local.tee 12 + local.get 0 + i32.load offset=24 + local.tee 10 + local.get 8 + local.get 2 + local.get 3 + call $core::fmt::Formatter::pad_integral::write_prefix + br_if 2 (;@1;) + local.get 1 + local.get 6 + i32.sub + i32.const 1 + i32.add + local.set 1 + block ;; label = @4 + loop ;; label = @5 + local.get 1 + i32.const -1 + i32.add + local.tee 1 + i32.eqz + br_if 1 (;@4;) + local.get 12 + i32.const 48 + local.get 10 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@5;) + end + i32.const 1 + return + end + block ;; label = @4 local.get 12 - i32.const 48 + local.get 4 + local.get 5 local.get 10 - i32.load offset=16 - call_indirect (type 1) + i32.load offset=12 + call_indirect (type 0) i32.eqz br_if 0 (;@4;) + i32.const 1 + return end - i32.const 1 + local.get 0 + local.get 7 + i32.store8 offset=32 + local.get 0 + local.get 9 + i32.store offset=16 + i32.const 0 return end - i32.const 1 - local.set 1 - local.get 12 + local.get 1 local.get 4 local.get 5 - local.get 10 + local.get 12 i32.load offset=12 call_indirect (type 0) - br_if 1 (;@1;) - local.get 0 - local.get 7 - i32.store8 offset=32 - local.get 0 - local.get 11 - i32.store offset=16 - i32.const 0 - local.set 1 + local.set 11 br 1 (;@1;) end - local.get 9 + local.get 1 local.get 6 i32.sub local.set 6 @@ -3008,7 +2999,7 @@ return end i32.const 1 - local.set 1 + local.set 11 local.get 10 local.get 12 local.get 8 @@ -3055,15 +3046,15 @@ i32.lt_u return end - local.get 1 + local.get 11 ) - (func $core::fmt::Write::write_fmt (;39;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::Write::write_fmt (;35;) (type 1) (param i32 i32) (result i32) local.get 0 - i32.const 1048928 + i32.const 1048932 local.get 1 call $core::fmt::write ) - (func $core::str::count::do_count_chars (;40;) (type 1) (param i32 i32) (result i32) + (func $core::str::count::do_count_chars (;36;) (type 1) (param i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 block ;; label = @2 @@ -3542,30 +3533,26 @@ end local.get 8 ) - (func $core::fmt::Formatter::pad_integral::write_prefix (;41;) (type 11) (param i32 i32 i32 i32 i32) (result i32) - (local i32) + (func $core::fmt::Formatter::pad_integral::write_prefix (;37;) (type 11) (param i32 i32 i32 i32 i32) (result i32) block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.const 1114112 - i32.eq - br_if 0 (;@3;) - i32.const 1 - local.set 5 - local.get 0 - local.get 2 - local.get 1 - i32.load offset=16 - call_indirect (type 1) - br_if 1 (;@2;) - end - local.get 3 - br_if 1 (;@1;) - i32.const 0 - local.set 5 - end - local.get 5 + local.get 2 + i32.const 1114112 + i32.eq + br_if 0 (;@1;) + local.get 0 + local.get 2 + local.get 1 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@1;) + i32.const 1 + return + end + block ;; label = @1 + local.get 3 + br_if 0 (;@1;) + i32.const 0 return end local.get 0 @@ -3575,7 +3562,7 @@ i32.load offset=12 call_indirect (type 0) ) - (func $core::fmt::Formatter::debug_struct (;42;) (type 9) (param i32 i32 i32 i32) + (func $core::fmt::Formatter::debug_struct (;38;) (type 9) (param i32 i32 i32 i32) local.get 1 i32.load offset=20 local.get 2 @@ -3595,66 +3582,14 @@ local.get 1 i32.store ) - (func $core::slice::index::slice_start_index_len_fail_rt (;43;) (type 7) (param i32 i32 i32) - (local i32 i64) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - local.get 1 - i32.store offset=4 - local.get 3 - local.get 0 - i32.store - local.get 3 - i32.const 2 - i32.store offset=12 - local.get 3 - i32.const 1049268 - i32.store offset=8 - local.get 3 - i64.const 2 - i64.store offset=20 align=4 - local.get 3 - i32.const 7 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 4 - local.get 3 - i32.const 4 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=40 - local.get 3 - local.get 4 - local.get 3 - i64.extend_i32_u - i64.or - i64.store offset=32 - local.get 3 - local.get 3 - i32.const 32 - i32.add - i32.store offset=16 - local.get 3 - i32.const 8 - i32.add - local.get 2 - call $core::panicking::panic_fmt - unreachable - ) - (func $core::fmt::num::imp::::fmt (;44;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::imp::::fmt (;39;) (type 1) (param i32 i32) (result i32) local.get 0 i64.load i32.const 1 local.get 1 call $core::fmt::num::imp::fmt_u64 ) - (func $core::fmt::num::imp::fmt_u64 (;45;) (type 15) (param i64 i32 i32) (result i32) + (func $core::fmt::num::imp::fmt_u64 (;40;) (type 15) (param i64 i32 i32) (result i32) (local i32 i32 i64 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -3701,7 +3636,7 @@ local.tee 8 i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3717,7 +3652,7 @@ i32.and i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3736,12 +3671,16 @@ end end block ;; label = @1 - local.get 5 - i32.wrap_i64 - local.tee 6 - i32.const 99 - i32.le_u - br_if 0 (;@1;) + block ;; label = @2 + local.get 5 + i64.const 99 + i64.gt_u + br_if 0 (;@2;) + local.get 5 + i32.wrap_i64 + local.set 6 + br 1 (;@1;) + end local.get 3 i32.const 9 i32.add @@ -3766,7 +3705,7 @@ i32.and i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3788,7 +3727,7 @@ local.get 6 i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3827,7 +3766,7 @@ global.set $__stack_pointer local.get 4 ) - (func $core::fmt::num::::fmt (;46;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::::fmt (;41;) (type 1) (param i32 i32) (result i32) (local i32 i64 i32) global.get $__stack_pointer i32.const 128 @@ -3886,13 +3825,13 @@ br_if 0 (;@1;) local.get 4 i32.const 128 - i32.const 1048996 + i32.const 1048992 call $core::slice::index::slice_start_index_len_fail unreachable end local.get 1 i32.const 1 - i32.const 1049012 + i32.const 1049008 i32.const 2 local.get 2 local.get 0 @@ -3910,7 +3849,7 @@ global.set $__stack_pointer local.get 0 ) - (func $core::fmt::num::::fmt (;47;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::::fmt (;42;) (type 1) (param i32 i32) (result i32) (local i32 i64 i32) global.get $__stack_pointer i32.const 128 @@ -3969,13 +3908,13 @@ br_if 0 (;@1;) local.get 4 i32.const 128 - i32.const 1048996 + i32.const 1048992 call $core::slice::index::slice_start_index_len_fail unreachable end local.get 1 i32.const 1 - i32.const 1049012 + i32.const 1049008 i32.const 2 local.get 2 local.get 0 @@ -3993,22 +3932,22 @@ global.set $__stack_pointer local.get 0 ) - (func $cabi_realloc (;48;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;43;) (type 8) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 17 17 funcref) + (table (;0;) 13 13 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:base/note-script@1.0.0#note-script" (func $miden:base/note-script@1.0.0#note-script)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId> $<&T as core::fmt::Debug>::fmt $core::ptr::drop_in_place $core::fmt::num::::fmt $::fmt $cabi_realloc $core::fmt::num::imp::::fmt $<&T as core::fmt::Debug>::fmt $<&T as core::fmt::Display>::fmt $::fmt $core::ptr::drop_in_place $::type_id $core::ptr::drop_in_place $::write_str $::write_char $core::fmt::Write::write_fmt) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\04\00\00\00\04\00\00\00\02\00\00\00Feltinner\00\00\00\03\00\00\00\08\00\00\00\08\00\00\00\04\00\00\00AccountId\00\00\00\03\00\00\00\08\00\00\00\08\00\00\00\05\00\00\00src/lib.rs\00\00H\00\10\00\0a\00\00\00!\00\00\00,\00\00\00H\00\10\00\0a\00\00\00$\00\00\00\09\00\00\00\06\00\00\00\0b\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00index out of bounds: the len is but the index is \00\00\88\00\10\00 \00\00\00\a8\00\10\00\12\00\00\00==!=matchesassertion `left right` failed\0a left: \0a right: \00\d7\00\10\00\10\00\00\00\e7\00\10\00\17\00\00\00\fe\00\10\00\09\00\00\00 right` failed: \0a left: \00\00\00\d7\00\10\00\10\00\00\00 \01\10\00\10\00\00\000\01\10\00\09\00\00\00\fe\00\10\00\09\00\00\00: \00\00\0d\00\00\00\0c\00\00\00\04\00\00\00\0e\00\00\00\0f\00\00\00\10\00\00\00 { , {\0a,\0a} }library/core/src/fmt/num.rs\89\01\10\00\1b\00\00\00i\00\00\00\17\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899range start index out of range for slice of length \00\00~\02\10\00\12\00\00\00\90\02\10\00\22\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $<&T as core::fmt::Debug>::fmt $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports $core::fmt::num::::fmt $::fmt $cabi_realloc $core::fmt::num::imp::::fmt $<&T as core::fmt::Debug>::fmt $<&T as core::fmt::Display>::fmt $::fmt $::write_str $::write_char $core::fmt::Write::write_fmt) + (data $.rodata (;0;) (i32.const 1048576) "\00\00\00\00\04\00\00\00\04\00\00\00\01\00\00\00\02\00\00\00Felt\00\00\00\00\08\00\00\00\08\00\00\00\03\00\00\00innerAccountId\00\00\00\00\00\00\08\00\00\00\08\00\00\00\04\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00src/lib.rs\00\00\5c\00\10\00\0a\00\00\00!\00\00\00,\00\00\00\5c\00\10\00\0a\00\00\00$\00\00\00\09\00\00\00\05\00\00\00index out of bounds: the len is but the index is \00\00\8c\00\10\00 \00\00\00\ac\00\10\00\12\00\00\00==!=matchesassertion `left right` failed\0a left: \0a right: \00\db\00\10\00\10\00\00\00\eb\00\10\00\17\00\00\00\02\01\10\00\09\00\00\00 right` failed: \0a left: \00\00\00\db\00\10\00\10\00\00\00$\01\10\00\10\00\00\004\01\10\00\09\00\00\00\02\01\10\00\09\00\00\00: \00\00\00\00\00\00\0c\00\00\00\04\00\00\00\0a\00\00\00\0b\00\00\00\0c\00\00\00 { , {\0a,\0a} }core/src/fmt/num.rs\8d\01\10\00\13\00\00\00f\00\00\00\17\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899range start index out of range for slice of length \00\00z\02\10\00\12\00\00\00\8c\02\10\00\22\00\00\00") ) (core module (;1;) (type (;0;) (func (param i32))) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat index 6d205f879..1c738a7ab 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat @@ -17,16 +17,17 @@ br 0 (;@1;) end ) - (func $__rust_alloc (;2;) (type 2) (param i32 i32) (result i32) - i32.const 1048660 + (func $miden_sdk::bindings::__link_custom_section_describing_imports (;2;) (type 0)) + (func $__rust_alloc (;3;) (type 2) (param i32 i32) (result i32) + i32.const 1048652 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;3;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;4;) (type 3) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048660 + i32.const 1048652 local.get 2 local.get 3 call $::alloc @@ -42,7 +43,7 @@ i32.lt_u select memory.copy - i32.const 1048660 + i32.const 1048652 local.get 0 local.get 2 local.get 1 @@ -50,74 +51,69 @@ end local.get 4 ) - (func $miden:base/core-types@1.0.0#account-id-from-felt (;4;) (type 4) (param i64) (result i64) + (func $miden:base/core-types@1.0.0#account-id-from-felt (;5;) (type 4) (param i64) (result i64) call $wit_bindgen_rt::run_ctors_once local.get 0 ) - (func $miden:base/types@1.0.0#from-core-asset (;5;) (type 5) (param i64 i64 i64 i64) (result i32) + (func $miden:base/types@1.0.0#from-core-asset (;6;) (type 5) (param i64 i64 i64 i64) (result i32) call $wit_bindgen_rt::run_ctors_once - i32.const 1048576 + i32.const 1048584 i32.const 19 - i32.const 1048608 + i32.const 1048616 call $core::panicking::panic unreachable ) - (func $miden:base/types@1.0.0#to-core-asset (;6;) (type 6) (param i32 i64 i64 i64 i64) (result i32) + (func $miden:base/types@1.0.0#to-core-asset (;7;) (type 6) (param i32 i64 i64 i64 i64) (result i32) call $wit_bindgen_rt::run_ctors_once - i32.const 1048576 + i32.const 1048584 i32.const 19 - i32.const 1048624 + i32.const 1048632 call $core::panicking::panic unreachable ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;7;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;8;) (type 3) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1048664 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) + local.get 3 + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1048656 + drop local.get 3 - call $__rust_realloc + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;8;) (type 0) + (func $wit_bindgen_rt::run_ctors_once (;9;) (type 0) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048665 + i32.load8_u offset=1048657 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048665 + i32.store8 offset=1048657 end ) - (func $wee_alloc::alloc_first_fit (;9;) (type 7) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;10;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -422,7 +418,7 @@ end i32.const 0 ) - (func $::alloc (;10;) (type 7) (param i32 i32 i32) (result i32) + (func $::alloc (;11;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -526,7 +522,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;11;) (type 8) (param i32 i32 i32 i32) + (func $::dealloc (;12;) (type 8) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -556,39 +552,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -669,18 +648,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -699,7 +688,6 @@ i32.store end ) - (func $core::ptr::drop_in_place (;12;) (type 1) (param i32)) (func $core::panicking::panic_fmt (;13;) (type 9) (param i32 i32) (local i32) global.get $__stack_pointer @@ -708,6 +696,22 @@ local.tee 2 global.set $__stack_pointer local.get 2 + i32.const 16 + i32.add + local.get 0 + i32.const 16 + i32.add + i64.load align=4 + i64.store + local.get 2 + i32.const 8 + i32.add + local.get 0 + i32.const 8 + i32.add + i64.load align=4 + i64.store + local.get 2 i32.const 1 i32.store16 offset=28 local.get 2 @@ -715,16 +719,9 @@ i32.store offset=24 local.get 2 local.get 0 - i32.store offset=20 - local.get 2 - i32.const 1048644 - i32.store offset=16 - local.get 2 - i32.const 1 - i32.store offset=12 + i64.load align=4 + i64.store local.get 2 - i32.const 12 - i32.add call $rust_begin_unwind unreachable ) @@ -760,32 +757,24 @@ call $core::panicking::panic_fmt unreachable ) - (func $::type_id (;15;) (type 9) (param i32 i32) - local.get 0 - i64.const 5799598635382251841 - i64.store offset=8 - local.get 0 - i64.const 3885382061309546557 - i64.store - ) - (func $cabi_realloc (;16;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;15;) (type 3) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 4 4 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:base/core-types@1.0.0#account-id-from-felt" (func $miden:base/core-types@1.0.0#account-id-from-felt)) (export "miden:base/types@1.0.0#from-core-asset" (func $miden:base/types@1.0.0#from-core-asset)) (export "miden:base/types@1.0.0#to-core-asset" (func $miden:base/types@1.0.0#to-core-asset)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc $core::ptr::drop_in_place $::type_id) - (data $.rodata (;0;) (i32.const 1048576) "not yet implementedsrc/lib.rs\00\00\00\13\00\10\00\0a\00\00\00!\00\00\00\09\00\00\00\13\00\10\00\0a\00\00\00%\00\00\00\09\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $miden_sdk::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00not yet implementedsrc/lib.rs\00\00\00\1b\00\10\00\0a\00\00\00!\00\00\00\09\00\00\00\1b\00\10\00\0a\00\00\00%\00\00\00\09\00\00\00\02\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) diff --git a/tests/integration/src/compiler_test.rs b/tests/integration/src/compiler_test.rs index 28da0890c..9a4a46182 100644 --- a/tests/integration/src/compiler_test.rs +++ b/tests/integration/src/compiler_test.rs @@ -3,6 +3,7 @@ use core::panic; use std::{ borrow::Cow, + ffi::OsStr, fmt, fs, io::Read, path::{Path, PathBuf}, @@ -159,6 +160,8 @@ impl RustcTest { /// The various types of input artifacts that can be used to drive compiler tests pub enum CompilerTestInputType { + /// A project that uses `cargo miden build` to produce a Wasm module to use as input + CargoMiden(CargoTest), /// A project that uses `cargo component build` to produce a Wasm module to use as input CargoComponent(CargoTest), /// A project that uses `cargo build` to produce a core Wasm module to use as input @@ -223,11 +226,13 @@ impl CompilerTestBuilder { CompilerTestInputType::Cargo(ref mut config) => config.entrypoint.take(), CompilerTestInputType::CargoComponent(ref mut config) => config.entrypoint.take(), CompilerTestInputType::Rustc(_) => Some("__main".into()), + CompilerTestInputType::CargoMiden(ref mut config) => config.entrypoint.take(), }; let name = match source { CompilerTestInputType::Cargo(ref mut config) => config.name.as_ref(), CompilerTestInputType::CargoComponent(ref mut config) => config.name.as_ref(), CompilerTestInputType::Rustc(ref mut config) => config.name.as_ref(), + CompilerTestInputType::CargoMiden(ref mut config) => config.name.as_ref(), }; let entrypoint = entrypoint.as_deref().map(|entry| FunctionIdent { module: Ident::with_empty_span(Symbol::intern(name)), @@ -328,6 +333,11 @@ impl CompilerTestBuilder { pub fn build(self) -> CompilerTest { // Set up the command used to compile the test inputs (typically Rust -> Wasm) let mut command = match self.source { + CompilerTestInputType::CargoMiden(_) => { + let mut cmd = Command::new("cargo"); + cmd.arg("miden").arg("build"); + cmd + } CompilerTestInputType::CargoComponent(_) => { let mut cmd = Command::new("cargo"); cmd.arg("component").arg("build"); @@ -343,7 +353,10 @@ impl CompilerTestBuilder { // Extract the directory in which source code is presumed to exist (or will be placed) let project_dir = match self.source { - CompilerTestInputType::CargoComponent(CargoTest { + CompilerTestInputType::CargoMiden(CargoTest { + ref project_dir, .. + }) + | CompilerTestInputType::CargoComponent(CargoTest { ref project_dir, .. }) | CompilerTestInputType::Cargo(CargoTest { @@ -357,8 +370,14 @@ impl CompilerTestBuilder { // Cargo-based source types share a lot of configuration in common match self.source { - CompilerTestInputType::CargoComponent(ref config) - | CompilerTestInputType::Cargo(ref config) => { + CompilerTestInputType::CargoComponent(_) => { + let manifest_path = project_dir.join("Cargo.toml"); + command.arg("--manifest-path").arg(manifest_path).arg("--release"); + // Render Cargo output as JSON + command.arg("--message-format=json-render-diagnostics"); + } + + CompilerTestInputType::Cargo(ref config) => { let manifest_path = project_dir.join("Cargo.toml"); command .arg("--manifest-path") @@ -408,6 +427,40 @@ impl CompilerTestBuilder { // Build test match self.source { + CompilerTestInputType::CargoMiden(_) => { + let mut args = vec![command.get_program().to_str().unwrap().to_string()]; + let cmd_args: Vec = command + .get_args() + .collect::>() + .iter() + .map(|s| s.to_str().unwrap().to_string()) + .collect(); + args.extend(cmd_args); + let wasm_artifacts = cargo_miden::run(args.into_iter()).unwrap(); + let wasm_comp_path = &wasm_artifacts.first().unwrap(); + let artifact_name = + wasm_comp_path.file_stem().unwrap().to_str().unwrap().to_string(); + let input_file = InputFile::from_path(wasm_comp_path).unwrap(); + let mut inputs = vec![input_file]; + inputs.extend(self.link_masm_modules.into_iter().map(|(path, content)| { + let path = path.to_string(); + InputFile::new( + midenc_session::FileType::Masm, + InputType::Stdin { + name: path.into(), + input: content.into_bytes(), + }, + ) + })); + + CompilerTest { + config: self.config, + session: default_session(inputs, &self.midenc_flags), + artifact_name: artifact_name.into(), + entrypoint: self.entrypoint, + ..Default::default() + } + } CompilerTestInputType::CargoComponent(_) => { let mut child = command.spawn().unwrap_or_else(|_| { panic!( @@ -1174,7 +1227,8 @@ pub fn sdk_crate_path() -> PathBuf { /// Get the directory for the top-level workspace fn get_workspace_dir() -> String { // Get the directory for the integration test suite project - let cargo_manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let cargo_manifest_dir = std::env::var("CARGO_MANIFEST_DIR") + .unwrap_or(std::env::current_dir().unwrap().to_str().unwrap().to_string()); let cargo_manifest_dir_path = Path::new(&cargo_manifest_dir); // "Exit" the integration test suite project directory to the compiler workspace directory // i.e. out of the `tests/integration` directory diff --git a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock index b4a93b30f..c4b431fa0 100644 --- a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock +++ b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock @@ -552,7 +552,7 @@ dependencies = [ [[package]] name = "miden-base-sys" -version = "0.0.4" +version = "0.0.6" dependencies = [ "miden-assembly", "miden-stdlib-sys", @@ -650,7 +650,7 @@ dependencies = [ [[package]] name = "miden-sdk" -version = "0.0.4" +version = "0.0.6" dependencies = [ "miden-base-sys", "miden-sdk-alloc", @@ -667,11 +667,11 @@ dependencies = [ [[package]] name = "miden-sdk-alloc" -version = "0.0.4" +version = "0.0.6" [[package]] name = "miden-stdlib-sys" -version = "0.0.4" +version = "0.0.6" [[package]] name = "miden-thiserror" diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs index 9477639c2..c81aa3024 100644 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs @@ -1,5 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: #[allow(dead_code)] pub mod miden { #[allow(dead_code)] @@ -8,26 +6,26 @@ pub mod miden { pub mod core_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; /// Represents base field element in the field using Montgomery representation. /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range - /// [0, M). Field modulus M = 2^64 - 2^32 + 1 + /// The backing type is `f64` but the internal values are always integer in the range [0, M). + /// Field modulus M = 2^64 - 2^32 + 1 #[repr(C)] #[derive(Clone, Copy)] pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the size - /// that we need and we don't plan to support floating point - /// arithmetic in programs for Miden VM. + /// We plan to use f64 as the backing type for the field element. It has the size that we need and + /// we don't plan to support floating point arithmetic in programs for Miden VM. /// /// For now its u64 pub inner: u64, } impl ::core::fmt::Debug for Felt { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -35,19 +33,16 @@ pub mod miden { pub type Word = (Felt, Felt, Felt, Felt); /// Unique identifier of an account. /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely - /// identifies a single account and also specifies the type of the - /// underlying account. Specifically: + /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a + /// single account and also specifies the type of the underlying account. Specifically: /// - The two most significant bits of the ID specify the type of the account: /// - 00 - regular account with updatable code. /// - 01 - regular account with immutable code. /// - 10 - fungible asset faucet with immutable code. /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is - /// stored on-chain: + /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the - /// account state. + /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. /// As such the three most significant bits fully describes the type of the account. #[repr(C)] #[derive(Clone, Copy)] @@ -55,19 +50,24 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountId").field("inner", &self.inner).finish() } } - /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), - /// input_hash) + /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), input_hash) #[repr(C)] #[derive(Clone, Copy)] pub struct Recipient { pub inner: Word, } impl ::core::fmt::Debug for Recipient { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Recipient").field("inner", &self.inner).finish() } } @@ -77,55 +77,52 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Tag { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Tag").field("inner", &self.inner).finish() } } /// A fungible or a non-fungible asset. /// - /// All assets are encoded using a single word (4 elements) such that it is easy to - /// determine the type of an asset both inside and outside Miden VM. - /// Specifically: Element 1 will be: + /// All assets are encoded using a single word (4 elements) such that it is easy to determine the + /// type of an asset both inside and outside Miden VM. Specifically: + /// Element 1 will be: /// - ZERO for a fungible asset /// - non-ZERO for a non-fungible asset /// The most significant bit will be: /// - ONE for a fungible asset /// - ZERO for a non-fungible asset /// - /// The above properties guarantee that there can never be a collision between a - /// fungible and a non-fungible asset. + /// The above properties guarantee that there can never be a collision between a fungible and a + /// non-fungible asset. /// - /// The methodology for constructing fungible and non-fungible assets is described - /// below. + /// The methodology for constructing fungible and non-fungible assets is described below. /// /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet - /// which issued the asset. This guarantees the properties described above - /// (the first bit is ONE). + /// The most significant element of a fungible asset is set to the ID of the faucet which issued + /// the asset. This guarantees the properties described above (the first bit is ONE). /// - /// The least significant element is set to the amount of the asset. This amount cannot - /// be greater than 2^63 - 1 and thus requires 63-bits to store. + /// The least significant element is set to the amount of the asset. This amount cannot be greater + /// than 2^63 - 1 and thus requires 63-bits to store. /// /// Elements 1 and 2 are set to ZERO. /// - /// It is impossible to find a collision between two fungible assets issued by different - /// faucets as the faucet_id is included in the description of the asset and - /// this is guaranteed to be different for each faucet as per the faucet - /// creation logic. + /// It is impossible to find a collision between two fungible assets issued by different faucets as + /// the faucet_id is included in the description of the asset and this is guaranteed to be different + /// for each faucet as per the faucet creation logic. /// /// # Non-fungible assets /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to - /// 4 field + /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, - /// d3]. + /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. /// - Lastly, the most significant bit of d3 is set to ZERO. /// - /// It is impossible to find a collision between two non-fungible assets issued by - /// different faucets as the faucet_id is included in the description of the - /// non-fungible asset and this is guaranteed to be different as per the - /// faucet creation logic. Collision resistance for non-fungible assets + /// It is impossible to find a collision between two non-fungible assets issued by different faucets + /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed + /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets /// issued by the same faucet is ~2^95. #[repr(C)] #[derive(Clone, Copy)] @@ -133,7 +130,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for CoreAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("CoreAsset").field("inner", &self.inner).finish() } } @@ -144,7 +144,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Nonce { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Nonce").field("inner", &self.inner).finish() } } @@ -155,7 +158,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountHash").field("inner", &self.inner).finish() } } @@ -166,7 +172,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for BlockHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("BlockHash").field("inner", &self.inner).finish() } } @@ -177,7 +186,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageValue").field("inner", &self.inner).finish() } } @@ -188,7 +200,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageRoot").field("inner", &self.inner).finish() } } @@ -199,8 +214,13 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountCodeRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("AccountCodeRoot").field("inner", &self.inner).finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("AccountCodeRoot") + .field("inner", &self.inner) + .finish() } } /// Commitment to the account vault @@ -210,8 +230,13 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for VaultCommitment { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("VaultCommitment").field("inner", &self.inner).finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("VaultCommitment") + .field("inner", &self.inner) + .finish() } } /// An id of the created note @@ -221,7 +246,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for NoteId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("NoteId").field("inner", &self.inner).finish() } } @@ -230,14 +258,12 @@ pub mod miden { pub fn account_id_from_felt(felt: Felt) -> AccountId { unsafe { let Felt { inner: inner0 } = felt; - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/core-types@1.0.0")] extern "C" { #[link_name = "account-id-from-felt"] fn wit_import(_: i64) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i64 { unreachable!() @@ -249,14 +275,11 @@ pub mod miden { } } } - #[allow(dead_code, clippy::all)] pub mod account { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Felt = super::super::super::miden::base::core_types::Felt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; @@ -265,10 +288,8 @@ pub mod miden { pub type AccountHash = super::super::super::miden::base::core_types::AccountHash; pub type StorageValue = super::super::super::miden::base::core_types::StorageValue; pub type StorageRoot = super::super::super::miden::base::core_types::StorageRoot; - pub type AccountCodeRoot = - super::super::super::miden::base::core_types::AccountCodeRoot; - pub type VaultCommitment = - super::super::super::miden::base::core_types::VaultCommitment; + pub type AccountCodeRoot = super::super::super::miden::base::core_types::AccountCodeRoot; + pub type VaultCommitment = super::super::super::miden::base::core_types::VaultCommitment; #[allow(unused_unsafe, clippy::all)] /// Get the id of the currently executing account pub fn get_id() -> AccountId { @@ -279,7 +300,6 @@ pub mod miden { #[link_name = "get-id"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -302,7 +322,6 @@ pub mod miden { #[link_name = "get-nonce"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -329,7 +348,6 @@ pub mod miden { #[link_name = "get-initial-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -341,10 +359,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::AccountHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -363,7 +389,6 @@ pub mod miden { #[link_name = "get-current-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -375,10 +400,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::AccountHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -388,16 +421,15 @@ pub mod miden { /// value can be at most 2^32 - 1 otherwise this procedure panics pub fn incr_nonce(value: Felt) { unsafe { - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - value; - + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = value; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "incr-nonce"] fn wit_import(_: i64); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) { unreachable!() @@ -412,8 +444,9 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - index; + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = index; let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -421,7 +454,6 @@ pub mod miden { #[link_name = "get-item"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -433,10 +465,18 @@ pub mod miden { let l5 = *ptr1.add(24).cast::(); super::super::super::miden::base::core_types::StorageValue { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l5 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l5 as u64, + }, ), } } @@ -444,29 +484,47 @@ pub mod miden { #[allow(unused_unsafe, clippy::all)] /// Set the value of the specified key in the account storage /// Returns the old value of the key and the new storage root - pub fn set_item(index: Felt, value: StorageValue) -> (StorageRoot, StorageValue) { + pub fn set_item( + index: Felt, + value: StorageValue, + ) -> (StorageRoot, StorageValue) { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 64]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 64]); - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - index; + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = index; let super::super::super::miden::base::core_types::StorageValue { inner: inner1, } = value; let (t2_0, t2_1, t2_2, t2_3) = inner1; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t2_0; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t2_1; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t2_2; - let super::super::super::miden::base::core_types::Felt { inner: inner6 } = t2_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t2_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t2_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t2_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner6, + } = t2_3; let ptr7 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "set-item"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8); + fn wit_import( + _: i64, + _: i64, + _: i64, + _: i64, + _: i64, + _: *mut u8, + ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -534,18 +592,24 @@ pub mod miden { inner: inner0, } = code_root; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "set-code"] fn wit_import(_: i64, _: i64, _: i64, _: i64); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64) { unreachable!() @@ -565,24 +629,26 @@ pub mod miden { /// fungible asset. pub fn get_balance(account_id: AccountId) -> Felt { unsafe { - let super::super::super::miden::base::core_types::AccountId { inner: inner0 } = - account_id; - let super::super::super::miden::base::core_types::Felt { inner: inner1 } = - inner0; - + let super::super::super::miden::base::core_types::AccountId { + inner: inner0, + } = account_id; + let super::super::super::miden::base::core_types::Felt { + inner: inner1, + } = inner0; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "get-balance"] fn wit_import(_: i64) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i64 { unreachable!() } let ret = wit_import(_rt::as_i64(inner1)); - super::super::super::miden::base::core_types::Felt { inner: ret as u64 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -592,21 +658,28 @@ pub mod miden { /// whether the account vault has the asset of interest. pub fn has_non_fungible_asset(asset: CoreAsset) -> bool { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "has-non-fungible-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32 { unreachable!() @@ -631,13 +704,22 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -645,7 +727,6 @@ pub mod miden { #[link_name = "add-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -663,9 +744,15 @@ pub mod miden { let l10 = *ptr6.add(24).cast::(); super::super::super::miden::base::core_types::CoreAsset { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l7 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l8 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l9 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l7 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l8 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l9 as u64, + }, super::super::super::miden::base::core_types::Felt { inner: l10 as u64, }, @@ -680,13 +767,22 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -694,7 +790,6 @@ pub mod miden { #[link_name = "remove-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -712,9 +807,15 @@ pub mod miden { let l10 = *ptr6.add(24).cast::(); super::super::super::miden::base::core_types::CoreAsset { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l7 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l8 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l9 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l7 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l8 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l9 as u64, + }, super::super::super::miden::base::core_types::Felt { inner: l10 as u64, }, @@ -736,7 +837,6 @@ pub mod miden { #[link_name = "get-vault-commitment"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -748,23 +848,28 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::VaultCommitment { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } } } - #[allow(dead_code, clippy::all)] pub mod tx { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Felt = super::super::super::miden::base::core_types::Felt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; @@ -774,8 +879,7 @@ pub mod miden { pub type Word = super::super::super::miden::base::core_types::Word; pub type NoteId = super::super::super::miden::base::core_types::NoteId; #[allow(unused_unsafe, clippy::all)] - /// Returns the block number of the last known block at the time of transaction - /// execution. + /// Returns the block number of the last known block at the time of transaction execution. pub fn get_block_number() -> Felt { unsafe { #[cfg(target_arch = "wasm32")] @@ -784,13 +888,14 @@ pub mod miden { #[link_name = "get-block-number"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() } let ret = wit_import(); - super::super::super::miden::base::core_types::Felt { inner: ret as u64 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -807,7 +912,6 @@ pub mod miden { #[link_name = "get-block-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -819,10 +923,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::BlockHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -842,7 +954,6 @@ pub mod miden { #[link_name = "get-input-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -853,10 +964,18 @@ pub mod miden { let l3 = *ptr0.add(16).cast::(); let l4 = *ptr0.add(24).cast::(); ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ) } } @@ -875,7 +994,6 @@ pub mod miden { #[link_name = "get-output-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -886,10 +1004,18 @@ pub mod miden { let l3 = *ptr0.add(16).cast::(); let l4 = *ptr0.add(24).cast::(); ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ) } } @@ -899,30 +1025,50 @@ pub mod miden { /// tag is the tag to be included in the note. /// recipient is the recipient of the note. /// Returns the id of the created note. - pub fn create_note(asset: CoreAsset, tag: Tag, recipient: Recipient) -> NoteId { + pub fn create_note( + asset: CoreAsset, + tag: Tag, + recipient: Recipient, + ) -> NoteId { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - let super::super::super::miden::base::core_types::Tag { inner: inner6 } = tag; - let super::super::super::miden::base::core_types::Felt { inner: inner7 } = - inner6; - let super::super::super::miden::base::core_types::Recipient { inner: inner8 } = - recipient; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; + let super::super::super::miden::base::core_types::Tag { + inner: inner6, + } = tag; + let super::super::super::miden::base::core_types::Felt { + inner: inner7, + } = inner6; + let super::super::super::miden::base::core_types::Recipient { + inner: inner8, + } = recipient; let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { inner: inner10 } = - t9_0; - let super::super::super::miden::base::core_types::Felt { inner: inner11 } = - t9_1; - let super::super::super::miden::base::core_types::Felt { inner: inner12 } = - t9_2; - let super::super::super::miden::base::core_types::Felt { inner: inner13 } = - t9_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner10, + } = t9_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner11, + } = t9_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner12, + } = t9_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner13, + } = t9_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/tx@1.0.0")] extern "C" { @@ -939,7 +1085,6 @@ pub mod miden { _: i64, ) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -985,9 +1130,7 @@ pub mod exports { pub mod basic_wallet { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; pub type CoreAsset = super::super::super::super::miden::base::core_types::CoreAsset; pub type Tag = super::super::super::super::miden::base::core_types::Tag; @@ -1000,26 +1143,23 @@ pub mod exports { arg2: i64, arg3: i64, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - T::receive_asset( - super::super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::super::miden::base::core_types::Felt { - inner: arg0 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg2 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg3 as u64, - }, - ), - }, - ); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + T::receive_asset(super::super::super::super::miden::base::core_types::CoreAsset { + inner: ( + super::super::super::super::miden::base::core_types::Felt { + inner: arg0 as u64, + }, + super::super::super::super::miden::base::core_types::Felt { + inner: arg1 as u64, + }, + super::super::super::super::miden::base::core_types::Felt { + inner: arg2 as u64, + }, + super::super::super::super::miden::base::core_types::Felt { + inner: arg3 as u64, + }, + ), + }); } #[doc(hidden)] #[allow(non_snake_case)] @@ -1034,8 +1174,7 @@ pub mod exports { arg7: i64, arg8: i64, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::send_asset( super::super::super::super::miden::base::core_types::CoreAsset { inner: ( @@ -1081,20 +1220,21 @@ pub mod exports { fn send_asset(core_asset: CoreAsset, tag: Tag, recipient: Recipient); } #[doc(hidden)] - - macro_rules! __export_miden_basic_wallet_basic_wallet_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] - unsafe extern "C" fn export_receive_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) { - $($path_to_types)*::_export_receive_asset_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] - unsafe extern "C" fn export_send_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,arg4: i64,arg5: i64,arg6: i64,arg7: i64,arg8: i64,) { - $($path_to_types)*::_export_send_asset_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) - } - };); - } + macro_rules! __export_miden_basic_wallet_basic_wallet_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] unsafe + extern "C" fn export_receive_asset(arg0 : i64, arg1 : i64, arg2 : + i64, arg3 : i64,) { $($path_to_types)*:: + _export_receive_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } + #[export_name = + "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] unsafe extern + "C" fn export_send_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 + : i64, arg4 : i64, arg5 : i64, arg6 : i64, arg7 : i64, arg8 : + i64,) { $($path_to_types)*:: _export_send_asset_cabi::<$ty > + (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_basic_wallet_basic_wallet_1_0_0_cabi; } @@ -1102,28 +1242,23 @@ pub mod exports { } } mod _rt { - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -1141,13 +1276,11 @@ mod _rt { val != 0 } } - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -1166,18 +1299,21 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_basic_wallet_world_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::miden::basic_wallet::basic_wallet::__export_miden_basic_wallet_basic_wallet_1_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::miden::basic_wallet::basic_wallet); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::basic_wallet::basic_wallet::__export_miden_basic_wallet_basic_wallet_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::miden::basic_wallet::basic_wallet); + }; } #[doc(inline)] pub(crate) use __export_basic_wallet_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:basic-wallet-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:basic-wallet-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2072] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x8f\x0f\x01A\x02\x01\ @@ -1230,11 +1366,9 @@ put-notes-hash\x01\x1e\x01@\x03\x05asset\x03\x03tag\x05\x09recipient\x07\0\x1b\x ient\x05\x01\0\x04\0\x0asend-asset\x01\x07\x04\x01%miden:basic-wallet/basic-wall\ et@1.0.0\x05\x11\x04\x01+miden:basic-wallet/basic-wallet-world@1.0.0\x04\0\x0b\x18\ \x01\0\x12basic-wallet-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0d\ -wit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +wit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); } diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs index 1e6fc85c2..45bff2b7d 100644 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs @@ -1,6 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: -// * additional derives ["PartialEq"] #[allow(dead_code)] pub mod miden { #[allow(dead_code)] @@ -9,26 +6,26 @@ pub mod miden { pub mod core_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; /// Represents base field element in the field using Montgomery representation. /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range - /// [0, M). Field modulus M = 2^64 - 2^32 + 1 + /// The backing type is `f64` but the internal values are always integer in the range [0, M). + /// Field modulus M = 2^64 - 2^32 + 1 #[repr(C)] #[derive(Clone, Copy, PartialEq)] pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the size - /// that we need and we don't plan to support floating point - /// arithmetic in programs for Miden VM. + /// We plan to use f64 as the backing type for the field element. It has the size that we need and + /// we don't plan to support floating point arithmetic in programs for Miden VM. /// /// For now its u64 pub inner: u64, } impl ::core::fmt::Debug for Felt { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -36,19 +33,16 @@ pub mod miden { pub type Word = (Felt, Felt, Felt, Felt); /// Unique identifier of an account. /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely - /// identifies a single account and also specifies the type of the - /// underlying account. Specifically: + /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a + /// single account and also specifies the type of the underlying account. Specifically: /// - The two most significant bits of the ID specify the type of the account: /// - 00 - regular account with updatable code. /// - 01 - regular account with immutable code. /// - 10 - fungible asset faucet with immutable code. /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is - /// stored on-chain: + /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the - /// account state. + /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. /// As such the three most significant bits fully describes the type of the account. #[repr(C)] #[derive(Clone, Copy, PartialEq)] @@ -56,19 +50,24 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountId").field("inner", &self.inner).finish() } } - /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), - /// input_hash) + /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), input_hash) #[repr(C)] #[derive(Clone, Copy, PartialEq)] pub struct Recipient { pub inner: Word, } impl ::core::fmt::Debug for Recipient { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Recipient").field("inner", &self.inner).finish() } } @@ -78,55 +77,52 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Tag { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Tag").field("inner", &self.inner).finish() } } /// A fungible or a non-fungible asset. /// - /// All assets are encoded using a single word (4 elements) such that it is easy to - /// determine the type of an asset both inside and outside Miden VM. - /// Specifically: Element 1 will be: + /// All assets are encoded using a single word (4 elements) such that it is easy to determine the + /// type of an asset both inside and outside Miden VM. Specifically: + /// Element 1 will be: /// - ZERO for a fungible asset /// - non-ZERO for a non-fungible asset /// The most significant bit will be: /// - ONE for a fungible asset /// - ZERO for a non-fungible asset /// - /// The above properties guarantee that there can never be a collision between a - /// fungible and a non-fungible asset. + /// The above properties guarantee that there can never be a collision between a fungible and a + /// non-fungible asset. /// - /// The methodology for constructing fungible and non-fungible assets is described - /// below. + /// The methodology for constructing fungible and non-fungible assets is described below. /// /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet - /// which issued the asset. This guarantees the properties described above - /// (the first bit is ONE). + /// The most significant element of a fungible asset is set to the ID of the faucet which issued + /// the asset. This guarantees the properties described above (the first bit is ONE). /// - /// The least significant element is set to the amount of the asset. This amount cannot - /// be greater than 2^63 - 1 and thus requires 63-bits to store. + /// The least significant element is set to the amount of the asset. This amount cannot be greater + /// than 2^63 - 1 and thus requires 63-bits to store. /// /// Elements 1 and 2 are set to ZERO. /// - /// It is impossible to find a collision between two fungible assets issued by different - /// faucets as the faucet_id is included in the description of the asset and - /// this is guaranteed to be different for each faucet as per the faucet - /// creation logic. + /// It is impossible to find a collision between two fungible assets issued by different faucets as + /// the faucet_id is included in the description of the asset and this is guaranteed to be different + /// for each faucet as per the faucet creation logic. /// /// # Non-fungible assets /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to - /// 4 field + /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, - /// d3]. + /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. /// - Lastly, the most significant bit of d3 is set to ZERO. /// - /// It is impossible to find a collision between two non-fungible assets issued by - /// different faucets as the faucet_id is included in the description of the - /// non-fungible asset and this is guaranteed to be different as per the - /// faucet creation logic. Collision resistance for non-fungible assets + /// It is impossible to find a collision between two non-fungible assets issued by different faucets + /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed + /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets /// issued by the same faucet is ~2^95. #[repr(C)] #[derive(Clone, Copy, PartialEq)] @@ -134,7 +130,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for CoreAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("CoreAsset").field("inner", &self.inner).finish() } } @@ -145,7 +144,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Nonce { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Nonce").field("inner", &self.inner).finish() } } @@ -156,7 +158,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountHash").field("inner", &self.inner).finish() } } @@ -167,7 +172,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for BlockHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("BlockHash").field("inner", &self.inner).finish() } } @@ -178,7 +186,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageValue").field("inner", &self.inner).finish() } } @@ -189,7 +200,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageRoot").field("inner", &self.inner).finish() } } @@ -200,8 +214,13 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountCodeRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("AccountCodeRoot").field("inner", &self.inner).finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("AccountCodeRoot") + .field("inner", &self.inner) + .finish() } } /// Commitment to the account vault @@ -211,8 +230,13 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for VaultCommitment { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("VaultCommitment").field("inner", &self.inner).finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("VaultCommitment") + .field("inner", &self.inner) + .finish() } } /// An id of the created note @@ -222,7 +246,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for NoteId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("NoteId").field("inner", &self.inner).finish() } } @@ -231,14 +258,12 @@ pub mod miden { pub fn account_id_from_felt(felt: Felt) -> AccountId { unsafe { let Felt { inner: inner0 } = felt; - #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/core-types@1.0.0")] extern "C" { #[link_name = "account-id-from-felt"] fn wit_import(_: i64) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i64 { unreachable!() @@ -250,14 +275,11 @@ pub mod miden { } } } - #[allow(dead_code, clippy::all)] pub mod tx { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Felt = super::super::super::miden::base::core_types::Felt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; @@ -267,8 +289,7 @@ pub mod miden { pub type Word = super::super::super::miden::base::core_types::Word; pub type NoteId = super::super::super::miden::base::core_types::NoteId; #[allow(unused_unsafe, clippy::all)] - /// Returns the block number of the last known block at the time of transaction - /// execution. + /// Returns the block number of the last known block at the time of transaction execution. pub fn get_block_number() -> Felt { unsafe { #[cfg(target_arch = "wasm32")] @@ -277,13 +298,14 @@ pub mod miden { #[link_name = "get-block-number"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() } let ret = wit_import(); - super::super::super::miden::base::core_types::Felt { inner: ret as u64 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -300,7 +322,6 @@ pub mod miden { #[link_name = "get-block-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -312,10 +333,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::BlockHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -335,7 +364,6 @@ pub mod miden { #[link_name = "get-input-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -346,10 +374,18 @@ pub mod miden { let l3 = *ptr0.add(16).cast::(); let l4 = *ptr0.add(24).cast::(); ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ) } } @@ -368,7 +404,6 @@ pub mod miden { #[link_name = "get-output-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -379,10 +414,18 @@ pub mod miden { let l3 = *ptr0.add(16).cast::(); let l4 = *ptr0.add(24).cast::(); ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ) } } @@ -392,30 +435,50 @@ pub mod miden { /// tag is the tag to be included in the note. /// recipient is the recipient of the note. /// Returns the id of the created note. - pub fn create_note(asset: CoreAsset, tag: Tag, recipient: Recipient) -> NoteId { + pub fn create_note( + asset: CoreAsset, + tag: Tag, + recipient: Recipient, + ) -> NoteId { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - let super::super::super::miden::base::core_types::Tag { inner: inner6 } = tag; - let super::super::super::miden::base::core_types::Felt { inner: inner7 } = - inner6; - let super::super::super::miden::base::core_types::Recipient { inner: inner8 } = - recipient; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; + let super::super::super::miden::base::core_types::Tag { + inner: inner6, + } = tag; + let super::super::super::miden::base::core_types::Felt { + inner: inner7, + } = inner6; + let super::super::super::miden::base::core_types::Recipient { + inner: inner8, + } = recipient; let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { inner: inner10 } = - t9_0; - let super::super::super::miden::base::core_types::Felt { inner: inner11 } = - t9_1; - let super::super::super::miden::base::core_types::Felt { inner: inner12 } = - t9_2; - let super::super::super::miden::base::core_types::Felt { inner: inner13 } = - t9_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner10, + } = t9_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner11, + } = t9_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner12, + } = t9_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner13, + } = t9_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/tx@1.0.0")] extern "C" { @@ -432,7 +495,6 @@ pub mod miden { _: i64, ) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -466,14 +528,11 @@ pub mod miden { } } } - #[allow(dead_code, clippy::all)] pub mod account { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Felt = super::super::super::miden::base::core_types::Felt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; @@ -482,10 +541,8 @@ pub mod miden { pub type AccountHash = super::super::super::miden::base::core_types::AccountHash; pub type StorageValue = super::super::super::miden::base::core_types::StorageValue; pub type StorageRoot = super::super::super::miden::base::core_types::StorageRoot; - pub type AccountCodeRoot = - super::super::super::miden::base::core_types::AccountCodeRoot; - pub type VaultCommitment = - super::super::super::miden::base::core_types::VaultCommitment; + pub type AccountCodeRoot = super::super::super::miden::base::core_types::AccountCodeRoot; + pub type VaultCommitment = super::super::super::miden::base::core_types::VaultCommitment; #[allow(unused_unsafe, clippy::all)] /// Get the id of the currently executing account pub fn get_id() -> AccountId { @@ -496,7 +553,6 @@ pub mod miden { #[link_name = "get-id"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -519,7 +575,6 @@ pub mod miden { #[link_name = "get-nonce"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -546,7 +601,6 @@ pub mod miden { #[link_name = "get-initial-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -558,10 +612,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::AccountHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -580,7 +642,6 @@ pub mod miden { #[link_name = "get-current-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -592,10 +653,18 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::AccountHash { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } @@ -605,16 +674,15 @@ pub mod miden { /// value can be at most 2^32 - 1 otherwise this procedure panics pub fn incr_nonce(value: Felt) { unsafe { - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - value; - + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = value; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "incr-nonce"] fn wit_import(_: i64); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) { unreachable!() @@ -629,8 +697,9 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - index; + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = index; let ptr1 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -638,7 +707,6 @@ pub mod miden { #[link_name = "get-item"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -650,10 +718,18 @@ pub mod miden { let l5 = *ptr1.add(24).cast::(); super::super::super::miden::base::core_types::StorageValue { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l5 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l5 as u64, + }, ), } } @@ -661,29 +737,47 @@ pub mod miden { #[allow(unused_unsafe, clippy::all)] /// Set the value of the specified key in the account storage /// Returns the old value of the key and the new storage root - pub fn set_item(index: Felt, value: StorageValue) -> (StorageRoot, StorageValue) { + pub fn set_item( + index: Felt, + value: StorageValue, + ) -> (StorageRoot, StorageValue) { unsafe { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 64]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 64]); - let super::super::super::miden::base::core_types::Felt { inner: inner0 } = - index; + let super::super::super::miden::base::core_types::Felt { + inner: inner0, + } = index; let super::super::super::miden::base::core_types::StorageValue { inner: inner1, } = value; let (t2_0, t2_1, t2_2, t2_3) = inner1; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t2_0; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t2_1; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t2_2; - let super::super::super::miden::base::core_types::Felt { inner: inner6 } = t2_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t2_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t2_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t2_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner6, + } = t2_3; let ptr7 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "set-item"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8); + fn wit_import( + _: i64, + _: i64, + _: i64, + _: i64, + _: i64, + _: *mut u8, + ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -751,18 +845,24 @@ pub mod miden { inner: inner0, } = code_root; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "set-code"] fn wit_import(_: i64, _: i64, _: i64, _: i64); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64) { unreachable!() @@ -782,24 +882,26 @@ pub mod miden { /// fungible asset. pub fn get_balance(account_id: AccountId) -> Felt { unsafe { - let super::super::super::miden::base::core_types::AccountId { inner: inner0 } = - account_id; - let super::super::super::miden::base::core_types::Felt { inner: inner1 } = - inner0; - + let super::super::super::miden::base::core_types::AccountId { + inner: inner0, + } = account_id; + let super::super::super::miden::base::core_types::Felt { + inner: inner1, + } = inner0; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "get-balance"] fn wit_import(_: i64) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64) -> i64 { unreachable!() } let ret = wit_import(_rt::as_i64(inner1)); - super::super::super::miden::base::core_types::Felt { inner: ret as u64 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -809,21 +911,28 @@ pub mod miden { /// whether the account vault has the asset of interest. pub fn has_non_fungible_asset(asset: CoreAsset) -> bool { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] extern "C" { #[link_name = "has-non-fungible-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32 { unreachable!() @@ -848,13 +957,22 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -862,7 +980,6 @@ pub mod miden { #[link_name = "add-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -880,9 +997,15 @@ pub mod miden { let l10 = *ptr6.add(24).cast::(); super::super::super::miden::base::core_types::CoreAsset { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l7 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l8 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l9 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l7 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l8 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l9 as u64, + }, super::super::super::miden::base::core_types::Felt { inner: l10 as u64, }, @@ -897,13 +1020,22 @@ pub mod miden { #[repr(align(8))] struct RetArea([::core::mem::MaybeUninit; 32]); let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; let ptr6 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:base/account@1.0.0")] @@ -911,7 +1043,6 @@ pub mod miden { #[link_name = "remove-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { unreachable!() @@ -929,9 +1060,15 @@ pub mod miden { let l10 = *ptr6.add(24).cast::(); super::super::super::miden::base::core_types::CoreAsset { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l7 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l8 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l9 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l7 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l8 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l9 as u64, + }, super::super::super::miden::base::core_types::Felt { inner: l10 as u64, }, @@ -953,7 +1090,6 @@ pub mod miden { #[link_name = "get-vault-commitment"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -965,23 +1101,28 @@ pub mod miden { let l4 = *ptr0.add(24).cast::(); super::super::super::miden::base::core_types::VaultCommitment { inner: ( - super::super::super::miden::base::core_types::Felt { inner: l1 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l2 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l3 as u64 }, - super::super::super::miden::base::core_types::Felt { inner: l4 as u64 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } } } - #[allow(dead_code, clippy::all)] pub mod note { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type Felt = super::super::super::miden::base::core_types::Felt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; @@ -1000,7 +1141,6 @@ pub mod miden { #[link_name = "get-inputs"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -1026,7 +1166,6 @@ pub mod miden { #[link_name = "get-assets"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -1048,7 +1187,6 @@ pub mod miden { #[link_name = "get-sender"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -1069,9 +1207,7 @@ pub mod miden { pub mod basic_wallet { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; use super::super::super::_rt; pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; pub type Tag = super::super::super::miden::base::core_types::Tag; @@ -1079,21 +1215,28 @@ pub mod miden { #[allow(unused_unsafe, clippy::all)] pub fn receive_asset(core_asset: CoreAsset) { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - core_asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = core_asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:basic-wallet/basic-wallet@1.0.0")] extern "C" { #[link_name = "receive-asset"] fn wit_import(_: i64, _: i64, _: i64, _: i64); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: i64, _: i64, _: i64) { unreachable!() @@ -1109,28 +1252,44 @@ pub mod miden { #[allow(unused_unsafe, clippy::all)] pub fn send_asset(core_asset: CoreAsset, tag: Tag, recipient: Recipient) { unsafe { - let super::super::super::miden::base::core_types::CoreAsset { inner: inner0 } = - core_asset; + let super::super::super::miden::base::core_types::CoreAsset { + inner: inner0, + } = core_asset; let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { inner: inner2 } = t1_0; - let super::super::super::miden::base::core_types::Felt { inner: inner3 } = t1_1; - let super::super::super::miden::base::core_types::Felt { inner: inner4 } = t1_2; - let super::super::super::miden::base::core_types::Felt { inner: inner5 } = t1_3; - let super::super::super::miden::base::core_types::Tag { inner: inner6 } = tag; - let super::super::super::miden::base::core_types::Felt { inner: inner7 } = - inner6; - let super::super::super::miden::base::core_types::Recipient { inner: inner8 } = - recipient; + let super::super::super::miden::base::core_types::Felt { + inner: inner2, + } = t1_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner3, + } = t1_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner4, + } = t1_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner5, + } = t1_3; + let super::super::super::miden::base::core_types::Tag { + inner: inner6, + } = tag; + let super::super::super::miden::base::core_types::Felt { + inner: inner7, + } = inner6; + let super::super::super::miden::base::core_types::Recipient { + inner: inner8, + } = recipient; let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { inner: inner10 } = - t9_0; - let super::super::super::miden::base::core_types::Felt { inner: inner11 } = - t9_1; - let super::super::super::miden::base::core_types::Felt { inner: inner12 } = - t9_2; - let super::super::super::miden::base::core_types::Felt { inner: inner13 } = - t9_3; - + let super::super::super::miden::base::core_types::Felt { + inner: inner10, + } = t9_0; + let super::super::super::miden::base::core_types::Felt { + inner: inner11, + } = t9_1; + let super::super::super::miden::base::core_types::Felt { + inner: inner12, + } = t9_2; + let super::super::super::miden::base::core_types::Felt { + inner: inner13, + } = t9_3; #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "miden:basic-wallet/basic-wallet@1.0.0")] extern "C" { @@ -1147,7 +1306,6 @@ pub mod miden { _: i64, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -1188,31 +1346,26 @@ pub mod exports { pub mod note_script { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_note_script_cabi() { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::note_script(); } pub trait Guest { fn note_script(); } #[doc(hidden)] - - macro_rules! __export_miden_base_note_script_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:base/note-script@1.0.0#note-script"] - unsafe extern "C" fn export_note_script() { - $($path_to_types)*::_export_note_script_cabi::<$ty>() - } - };); - } + macro_rules! __export_miden_base_note_script_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/note-script@1.0.0#note-script"] unsafe extern "C" fn + export_note_script() { $($path_to_types)*:: + _export_note_script_cabi::<$ty > () } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_note_script_1_0_0_cabi; } @@ -1220,28 +1373,23 @@ pub mod exports { } } mod _rt { - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -1260,14 +1408,12 @@ mod _rt { } } pub use alloc_crate::vec::Vec; - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } extern crate alloc as alloc_crate; } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -1286,18 +1432,20 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_notes_world_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::miden::base::note_script::__export_miden_base_note_script_1_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::miden::base::note_script); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::base::note_script::__export_miden_base_note_script_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::note_script); + }; } #[doc(inline)] pub(crate) use __export_notes_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:notes-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:notes-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2434] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x80\x12\x01A\x02\x01\ @@ -1360,11 +1508,9 @@ set\x01\x01\0\x04\0\x0dreceive-asset\x01\x06\x01@\x03\x0acore-asset\x01\x03tag\x asic-wallet@1.0.0\x05\x12\x01B\x02\x01@\0\x01\0\x04\0\x0bnote-script\x01\0\x04\x01\ \x1cmiden:base/note-script@1.0.0\x05\x13\x04\x01\x1cmiden:p2id/notes-world@1.0.0\ \x04\0\x0b\x11\x01\0\x0bnotes-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); } diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs index e5a194d17..fc063acda 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs @@ -1,5 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: #[allow(dead_code)] pub mod exports { #[allow(dead_code)] @@ -10,26 +8,26 @@ pub mod exports { pub mod core_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; /// Represents base field element in the field using Montgomery representation. /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the - /// range [0, M). Field modulus M = 2^64 - 2^32 + 1 + /// The backing type is `f64` but the internal values are always integer in the range [0, M). + /// Field modulus M = 2^64 - 2^32 + 1 #[repr(C)] #[derive(Clone, Copy)] pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the - /// size that we need and we don't plan to support floating - /// point arithmetic in programs for Miden VM. + /// We plan to use f64 as the backing type for the field element. It has the size that we need and + /// we don't plan to support floating point arithmetic in programs for Miden VM. /// /// For now its u64 pub inner: u64, } impl ::core::fmt::Debug for Felt { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -37,19 +35,16 @@ pub mod exports { pub type Word = (Felt, Felt, Felt, Felt); /// Unique identifier of an account. /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely - /// identifies a single account and also specifies the type of the - /// underlying account. Specifically: + /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a + /// single account and also specifies the type of the underlying account. Specifically: /// - The two most significant bits of the ID specify the type of the account: /// - 00 - regular account with updatable code. /// - 01 - regular account with immutable code. /// - 10 - fungible asset faucet with immutable code. /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is - /// stored on-chain: + /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to - /// the account state. + /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. /// As such the three most significant bits fully describes the type of the account. #[repr(C)] #[derive(Clone, Copy)] @@ -57,72 +52,72 @@ pub mod exports { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountId").field("inner", &self.inner).finish() } } /// A fungible or a non-fungible asset. /// - /// All assets are encoded using a single word (4 elements) such that it is easy to - /// determine the type of an asset both inside and outside Miden VM. - /// Specifically: Element 1 will be: + /// All assets are encoded using a single word (4 elements) such that it is easy to determine the + /// type of an asset both inside and outside Miden VM. Specifically: + /// Element 1 will be: /// - ZERO for a fungible asset /// - non-ZERO for a non-fungible asset /// The most significant bit will be: /// - ONE for a fungible asset /// - ZERO for a non-fungible asset /// - /// The above properties guarantee that there can never be a collision between a - /// fungible and a non-fungible asset. + /// The above properties guarantee that there can never be a collision between a fungible and a + /// non-fungible asset. /// - /// The methodology for constructing fungible and non-fungible assets is described - /// below. + /// The methodology for constructing fungible and non-fungible assets is described below. /// /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet - /// which issued the asset. This guarantees the properties described - /// above (the first bit is ONE). + /// The most significant element of a fungible asset is set to the ID of the faucet which issued + /// the asset. This guarantees the properties described above (the first bit is ONE). /// - /// The least significant element is set to the amount of the asset. This amount - /// cannot be greater than 2^63 - 1 and thus requires 63-bits to - /// store. + /// The least significant element is set to the amount of the asset. This amount cannot be greater + /// than 2^63 - 1 and thus requires 63-bits to store. /// /// Elements 1 and 2 are set to ZERO. /// - /// It is impossible to find a collision between two fungible assets issued by - /// different faucets as the faucet_id is included in the - /// description of the asset and this is guaranteed to be different + /// It is impossible to find a collision between two fungible assets issued by different faucets as + /// the faucet_id is included in the description of the asset and this is guaranteed to be different /// for each faucet as per the faucet creation logic. /// /// # Non-fungible assets /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary - /// length to 4 field + /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, - /// d2, d3]. + /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. /// - Lastly, the most significant bit of d3 is set to ZERO. /// - /// It is impossible to find a collision between two non-fungible assets issued by - /// different faucets as the faucet_id is included in the - /// description of the non-fungible asset and this is guaranteed - /// to be different as per the faucet creation logic. Collision resistance for - /// non-fungible assets issued by the same faucet is ~2^95. + /// It is impossible to find a collision between two non-fungible assets issued by different faucets + /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed + /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets + /// issued by the same faucet is ~2^95. #[repr(C)] #[derive(Clone, Copy)] pub struct CoreAsset { pub inner: Word, } impl ::core::fmt::Debug for CoreAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("CoreAsset").field("inner", &self.inner).finish() } } #[doc(hidden)] #[allow(non_snake_case)] - pub unsafe fn _export_account_id_from_felt_cabi(arg0: i64) -> i64 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + pub unsafe fn _export_account_id_from_felt_cabi( + arg0: i64, + ) -> i64 { + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let result0 = T::account_id_from_felt(Felt { inner: arg0 as u64 }); let AccountId { inner: inner1 } = result0; let Felt { inner: inner2 } = inner1; @@ -133,33 +128,27 @@ pub mod exports { fn account_id_from_felt(felt: Felt) -> AccountId; } #[doc(hidden)] - - macro_rules! __export_miden_base_core_types_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:base/core-types@1.0.0#account-id-from-felt"] - unsafe extern "C" fn export_account_id_from_felt(arg0: i64,) -> i64 { - $($path_to_types)*::_export_account_id_from_felt_cabi::<$ty>(arg0) - } - };); - } + macro_rules! __export_miden_base_core_types_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/core-types@1.0.0#account-id-from-felt"] unsafe extern + "C" fn export_account_id_from_felt(arg0 : i64,) -> i64 { + $($path_to_types)*:: _export_account_id_from_felt_cabi::<$ty > + (arg0) } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_core_types_1_0_0_cabi; } - #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; use super::super::super::super::_rt; - pub type AccountId = - super::super::super::super::exports::miden::base::core_types::AccountId; + pub type AccountId = super::super::super::super::exports::miden::base::core_types::AccountId; pub type Word = super::super::super::super::exports::miden::base::core_types::Word; - pub type CoreAsset = - super::super::super::super::exports::miden::base::core_types::CoreAsset; + pub type CoreAsset = super::super::super::super::exports::miden::base::core_types::CoreAsset; /// A fungible asset #[repr(C)] #[derive(Clone, Copy)] @@ -170,7 +159,10 @@ pub mod exports { pub amount: u64, } impl ::core::fmt::Debug for FungibleAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("FungibleAsset") .field("asset", &self.asset) .field("amount", &self.amount) @@ -179,10 +171,9 @@ pub mod exports { } /// A commitment to a non-fungible asset. /// - /// A non-fungible asset consists of 4 field elements which are computed by hashing - /// asset data (which can be of arbitrary length) to produce: [d0, - /// d1, d2, d3]. We then replace d1 with the faucet_id that issued - /// the asset: [d0, faucet_id, d2, d3]. We then set the most significant bit + /// A non-fungible asset consists of 4 field elements which are computed by hashing asset data + /// (which can be of arbitrary length) to produce: [d0, d1, d2, d3]. We then replace d1 with the + /// faucet_id that issued the asset: [d0, faucet_id, d2, d3]. We then set the most significant bit /// of the most significant element to ZERO. #[repr(C)] #[derive(Clone, Copy)] @@ -190,8 +181,13 @@ pub mod exports { pub inner: Word, } impl ::core::fmt::Debug for NonFungibleAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - f.debug_struct("NonFungibleAsset").field("inner", &self.inner).finish() + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { + f.debug_struct("NonFungibleAsset") + .field("inner", &self.inner) + .finish() } } /// A fungible or a non-fungible asset. @@ -201,7 +197,10 @@ pub mod exports { NonFungible(NonFungibleAsset), } impl ::core::fmt::Debug for Asset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Asset::Fungible(e) => { f.debug_tuple("Asset::Fungible").field(e).finish() @@ -220,29 +219,34 @@ pub mod exports { arg2: i64, arg3: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); - let result0 = T::from_core_asset(super::super::super::super::exports::miden::base::core_types::CoreAsset{ - inner: (super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg0 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg1 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg2 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg3 as u64, - }), - }); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); + let result0 = T::from_core_asset(super::super::super::super::exports::miden::base::core_types::CoreAsset { + inner: ( + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg0 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg1 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg2 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg3 as u64, + }, + ), + }); let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); match result0 { Asset::Fungible(e) => { *ptr1.add(0).cast::() = (0i32) as u8; - let FungibleAsset { - asset: asset2, - amount: amount2, - } = e; - let super::super::super::super::exports::miden::base::core_types::AccountId{ inner:inner3, } = asset2; - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner4, } = inner3; + let FungibleAsset { asset: asset2, amount: amount2 } = e; + let super::super::super::super::exports::miden::base::core_types::AccountId { + inner: inner3, + } = asset2; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner4, + } = inner3; *ptr1.add(8).cast::() = _rt::as_i64(inner4); *ptr1.add(16).cast::() = _rt::as_i64(amount2); } @@ -250,13 +254,21 @@ pub mod exports { *ptr1.add(0).cast::() = (1i32) as u8; let NonFungibleAsset { inner: inner5 } = e; let (t6_0, t6_1, t6_2, t6_3) = inner5; - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner7, } = t6_0; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner7, + } = t6_0; *ptr1.add(8).cast::() = _rt::as_i64(inner7); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner8, } = t6_1; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner8, + } = t6_1; *ptr1.add(16).cast::() = _rt::as_i64(inner8); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner9, } = t6_2; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner9, + } = t6_2; *ptr1.add(24).cast::() = _rt::as_i64(inner9); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner10, } = t6_3; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner10, + } = t6_3; *ptr1.add(32).cast::() = _rt::as_i64(inner10); } } @@ -271,33 +283,37 @@ pub mod exports { arg3: i64, arg4: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); let v0 = match arg0 { 0 => { - let e0 = FungibleAsset{ - asset: super::super::super::super::exports::miden::base::core_types::AccountId{ - inner: super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg1 as u64, - }, - }, - amount: arg2 as u64, - }; + let e0 = FungibleAsset { + asset: super::super::super::super::exports::miden::base::core_types::AccountId { + inner: super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg1 as u64, + }, + }, + amount: arg2 as u64, + }; Asset::Fungible(e0) } n => { debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = NonFungibleAsset{ - inner: (super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg1 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg2 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg3 as u64, - }, super::super::super::super::exports::miden::base::core_types::Felt{ - inner: arg4 as u64, - }), - }; + let e0 = NonFungibleAsset { + inner: ( + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg1 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg2 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg3 as u64, + }, + super::super::super::super::exports::miden::base::core_types::Felt { + inner: arg4 as u64, + }, + ), + }; Asset::NonFungible(e0) } }; @@ -332,57 +348,53 @@ pub mod exports { fn to_core_asset(asset: Asset) -> CoreAsset; } #[doc(hidden)] - - macro_rules! __export_miden_base_types_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:base/types@1.0.0#from-core-asset"] - unsafe extern "C" fn export_from_core_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) -> *mut u8 { - $($path_to_types)*::_export_from_core_asset_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - #[export_name = "miden:base/types@1.0.0#to-core-asset"] - unsafe extern "C" fn export_to_core_asset(arg0: i32,arg1: i64,arg2: i64,arg3: i64,arg4: i64,) -> *mut u8 { - $($path_to_types)*::_export_to_core_asset_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4) - } - };); - } + macro_rules! __export_miden_base_types_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/types@1.0.0#from-core-asset"] unsafe extern "C" fn + export_from_core_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 : + i64,) -> * mut u8 { $($path_to_types)*:: + _export_from_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } + #[export_name = "miden:base/types@1.0.0#to-core-asset"] unsafe + extern "C" fn export_to_core_asset(arg0 : i32, arg1 : i64, arg2 : + i64, arg3 : i64, arg4 : i64,) -> * mut u8 { $($path_to_types)*:: + _export_to_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4) + } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_types_1_0_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 40]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 40]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 40], + ); } } } } mod _rt { - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -390,7 +402,6 @@ mod _rt { } } } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -409,19 +420,23 @@ mod _rt { /// ``` #[allow(unused_macros)] #[doc(hidden)] - macro_rules! __export_base_world_impl { - ($ty:ident) => (self::export!($ty with_types_in self);); - ($ty:ident with_types_in $($path_to_types_root:tt)*) => ( - $($path_to_types_root)*::exports::miden::base::core_types::__export_miden_base_core_types_1_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::miden::base::core_types); - $($path_to_types_root)*::exports::miden::base::types::__export_miden_base_types_1_0_0_cabi!($ty with_types_in $($path_to_types_root)*::exports::miden::base::types); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::base::core_types::__export_miden_base_core_types_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::core_types); + $($path_to_types_root)*:: + exports::miden::base::types::__export_miden_base_types_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::types); + }; } #[doc(inline)] pub(crate) use __export_base_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:base-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:base-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 922] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x99\x06\x01A\x02\x01\ @@ -445,11 +460,9 @@ gible\x01\x0b\0\x04\0\x05asset\x03\0\x0c\x01@\x01\x0acore-asset\x07\0\x0d\x04\0\ from-core-asset\x01\x0e\x01@\x01\x05asset\x0d\0\x07\x04\0\x0dto-core-asset\x01\x0f\ \x04\x01\x16miden:base/types@1.0.0\x05\x05\x04\x01\x1bmiden:base/base-world@1.0.\ 0\x04\0\x0b\x10\x01\0\x0abase-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; - +\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); } diff --git a/tools/cargo-miden/CHANGELOG.md b/tools/cargo-miden/CHANGELOG.md index d21f2e6a5..948560d16 100644 --- a/tools/cargo-miden/CHANGELOG.md +++ b/tools/cargo-miden/CHANGELOG.md @@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.7](https://github.com/0xPolygonMiden/compiler/compare/cargo-miden-v0.0.6...cargo-miden-v0.0.7) - 2024-09-17 + +### Fixed +- switch cargo-miden to v0.4.0 of the new project template with + +### Other +- update cargo-component to v0.16.0 +- add `CompilerTestInputType::CargoMiden` and use `cargo-miden` build it + +## [0.0.6](https://github.com/0xpolygonmiden/compiler/compare/cargo-miden-v0.0.5...cargo-miden-v0.0.6) - 2024-09-06 + +### Other +- fix mkdocs warnings, move cargo-miden README to docs. +- clean up unused deps +- switch all crates to a single workspace version (0.0.5) + ## [0.0.2](https://github.com/0xPolygonMiden/compiler/compare/cargo-miden-v0.0.1...cargo-miden-v0.0.2) - 2024-08-30 ### Other diff --git a/tools/cargo-miden/Cargo.toml b/tools/cargo-miden/Cargo.toml index b7961705e..5dfdac61d 100644 --- a/tools/cargo-miden/Cargo.toml +++ b/tools/cargo-miden/Cargo.toml @@ -28,8 +28,8 @@ env_logger.workspace = true log.workspace = true clap.workspace = true anyhow.workspace = true -cargo-component = "0.6" -cargo-component-core = "0.6" +cargo-component = "0.16" +cargo-component-core = "0.16" cargo_metadata = "0.18" cargo-generate = "0.22" semver = "1.0.20" diff --git a/tools/cargo-miden/src/lib.rs b/tools/cargo-miden/src/lib.rs index 7078d2521..d413e8d5f 100644 --- a/tools/cargo-miden/src/lib.rs +++ b/tools/cargo-miden/src/lib.rs @@ -1,7 +1,6 @@ use std::path::PathBuf; use cargo_component::load_metadata; -use cargo_component_core::terminal::Terminal; use clap::{CommandFactory, Parser}; use config::CargoArguments; use midenc_session::diagnostics::Report; @@ -80,7 +79,7 @@ where None } -pub fn run(args: T, terminal: &Terminal) -> Result, Report> +pub fn run(args: T) -> Result, Report> where T: Iterator, { @@ -112,8 +111,8 @@ where // Not a built-in command, run the cargo command let cargo_args = CargoArguments::parse_from(args.clone().into_iter()).map_err(Report::msg)?; - let metadata = load_metadata(terminal, cargo_args.manifest_path.as_deref(), false) - .map_err(Report::msg)?; + let metadata = + load_metadata(cargo_args.manifest_path.as_deref()).map_err(Report::msg)?; if metadata.packages.is_empty() { return Err(Report::msg(format!( "manifest `{path}` contains no package or the workspace has no members", diff --git a/tools/cargo-miden/src/main.rs b/tools/cargo-miden/src/main.rs index df62bf60a..6129d0672 100644 --- a/tools/cargo-miden/src/main.rs +++ b/tools/cargo-miden/src/main.rs @@ -21,7 +21,7 @@ fn main() -> anyhow::Result<()> { cargo_args.color.unwrap_or_default(), ); - if let Err(e) = run(std::env::args(), &terminal) { + if let Err(e) = run(std::env::args()) { terminal.error(format!("{e:?}"))?; std::process::exit(1); } diff --git a/tools/cargo-miden/src/new_project.rs b/tools/cargo-miden/src/new_project.rs index 6c9638028..c4c26faff 100644 --- a/tools/cargo-miden/src/new_project.rs +++ b/tools/cargo-miden/src/new_project.rs @@ -74,7 +74,7 @@ impl NewCommand { }, None => TemplatePath { git: Some("https://github.com/0xPolygonMiden/rust-templates".into()), - tag: Some("v0.3.0".into()), + tag: Some("v0.4.0".into()), auto_path: Some("account".into()), ..Default::default() }, diff --git a/tools/cargo-miden/tests/build.rs b/tools/cargo-miden/tests/build.rs index a0a780308..12e155e80 100644 --- a/tools/cargo-miden/tests/build.rs +++ b/tools/cargo-miden/tests/build.rs @@ -1,6 +1,5 @@ use std::{env, fs, vec}; -use cargo_component_core::terminal; use cargo_miden::run; // NOTE: This test sets the current working directory so don't run it in parallel with tests @@ -43,19 +42,32 @@ fn build_new_project_from_template() { // ), // ); - let terminal = terminal::Terminal::new(terminal::Verbosity::Verbose, terminal::Color::Auto); - let outputs = run(args.into_iter(), &terminal).expect("Failed to create new project"); + let outputs = run(args.into_iter()).expect("Failed to create new project"); let new_project_path = outputs.first().unwrap().canonicalize().unwrap(); dbg!(&new_project_path); assert!(new_project_path.exists()); assert_eq!(new_project_path, expected_new_project_dir.canonicalize().unwrap()); env::set_current_dir(&new_project_path).unwrap(); + + // build with the dev profile + let args = ["cargo", "miden", "build"].iter().map(|s| s.to_string()); + let outputs = run(args).expect("Failed to compile with the dev profile"); + assert_eq!(outputs.len(), 1); + let expected_masm_path = outputs.first().unwrap(); + dbg!(&expected_masm_path); + assert!(expected_masm_path.exists()); + assert!(expected_masm_path.to_str().unwrap().contains("/debug/")); + assert!(expected_masm_path.metadata().unwrap().len() > 0); + // assert_eq!(expected_masm_path.metadata().unwrap().len(), 0); + + // build with the release profile let args = ["cargo", "miden", "build", "--release"].iter().map(|s| s.to_string()); - let outputs = run(args, &terminal).expect("Failed to compile"); + let outputs = run(args).expect("Failed to compile with the release profile"); + assert_eq!(outputs.len(), 1); let expected_masm_path = outputs.first().unwrap(); dbg!(&expected_masm_path); - // eprintln!("{}", String::from_utf8(fs::read(expected_masm_path).unwrap()).unwrap()); assert!(expected_masm_path.exists()); + assert!(expected_masm_path.to_str().unwrap().contains("/release/")); assert!(expected_masm_path.metadata().unwrap().len() > 0); env::set_current_dir(restore_dir).unwrap();