chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

1
vendor/zmij/.cargo-checksum.json vendored Normal file
View File

@@ -0,0 +1 @@
{"files":{".cargo_vcs_info.json":"8913f1e6dfcd0ef9af3438d4626a98d40ce9eab152b74d2f2654a7dd2f2c3427",".github/workflows/ci.yml":"d3e2feec0cb0be604244059c58abe6bc9062e1aab07dc73155362f0182d17b8c","Cargo.lock":"5e3468064ea2a4d4087cec511d587f2f2da61e8bb1fbbe19f59b6a3e58265a8d","Cargo.toml":"08f0f39b8b92d1a11c99d7dcf149455d8430f850cdd67d9b19091b919ca59c85","Cargo.toml.orig":"aa6108916aec21d92abc7c77510c9ee056f3265b910d34edaa1f52237eb08f30","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"6ffdb4e63905097bdaf199addab5fe55fc0813e6f3b74a31cc66302859a2fb13","benches/bench.rs":"28d23a29046c4d50c73a19fd81ad80cc97e474af6d8c30f81dcc8c9621065cca","build.rs":"13201b550236a9ff2186b5303c77341d3b0874989fdaf39613a7452e4ce57817","src/hint.rs":"7e03e3c031b7c20127517b794a4b641b3efb6ccd4c7b1aae1b7b6f28b9968052","src/lib.rs":"d843c3c1c8a41a8cdaead2ee3a223a204bf2ed047c3f2892719248a0f10d9bef","src/stdarch_x86.rs":"b19b4c54f0c08c92f96d18c152f796d85cc17f9e6195f3e7d5612f05f28836fb","src/tests.rs":"cd2726e2af3d111236dcd00a3b584270979a84ef0dc59e9162774b09824993a6","src/traits.rs":"d289ade8d66f03096349f1cf2d4e68fad792e7b089bc956410cf700d9aad67e1","tests/exhaustive.rs":"3d5c1036dcb391bfd038fcb9feb03380b467a184ed9e0463d52f35b521684029","tests/ryu_comparison.rs":"8bd55e9fe7a3121f124180983c319412ce87b886354f3f998da4789f9260fa06","tests/test.rs":"0f5efa4354a932d767ed561ddee411a10dd71faafa202372f3c00d81b88d1381"},"package":"b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"}

6
vendor/zmij/.cargo_vcs_info.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"git": {
"sha1": "6531ba31ccf5d14b604ca41f6e2414a8dd779af0"
},
"path_in_vcs": ""
}

152
vendor/zmij/.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,152 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
jobs:
pre_ci:
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master
test:
name: ${{matrix.os == 'macos' && 'macOS' || format('Rust {0} ({1})', matrix.rust, matrix.arch)}}
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ${{matrix.os == 'macos' && 'macos-latest' || matrix.arch == 'x86_64' && 'ubuntu-latest' || 'ubuntu-24.04-arm'}}
strategy:
fail-fast: false
matrix:
rust: [nightly, beta, stable, 1.86.0, 1.71.0]
arch: [x86_64, aarch64]
os: [ubuntu]
include:
- rust: nightly
os: macos
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: Enable type layout randomization
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
if: matrix.rust == 'nightly'
- run: cargo check
- run: cargo build --tests --features no-panic --release
if: matrix.rust == 'nightly'
- run: cargo test
if: matrix.rust != '1.71.0'
- run: cargo test --release
if: matrix.rust != '1.71.0'
- run: cargo check
env:
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native
- run: cargo build --tests --features no-panic --release
if: matrix.rust == 'nightly'
env:
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native
- run: cargo test
if: matrix.rust != '1.71.0'
env:
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native
- run: cargo test --release
if: matrix.rust != '1.71.0'
env:
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native
- uses: actions/upload-artifact@v6
if: matrix.rust == 'nightly' && matrix.arch == 'x86_64' && matrix.os == 'ubuntu' && always()
with:
name: Cargo.lock
path: Cargo.lock
continue-on-error: true
doc:
name: Documentation
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@clippy
with:
targets: aarch64-unknown-linux-gnu
- run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic
- run: cargo clippy --target=aarch64-unknown-linux-gnu -- -Dclippy::all -Dclippy::pedantic
- run: cargo clippy -- -Dclippy::all -Dclippy::pedantic
env:
RUSTFLAGS: ${{env.RUSTFLAGS}} -Ctarget-cpu=native
miri:
name: Miri (${{matrix.name}})
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 64-bit little endian
target: x86_64-unknown-linux-gnu
- name: 64-bit big endian
target: powerpc64-unknown-linux-gnu
- name: 32-bit little endian
target: i686-unknown-linux-gnu
- name: 32-bit big endian
target: mips-unknown-linux-gnu
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2026-02-11 # https://github.com/rust-lang/miri/issues/4855
components: miri, rust-src
- run: cargo miri setup
- run: cargo miri test --target ${{matrix.target}}
env:
MIRIFLAGS: -Zmiri-strict-provenance
outdated:
name: Outdated
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --exit-code 1
- run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1
fuzz:
name: Fuzz
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-fuzz
- run: cargo fuzz check

807
vendor/zmij/Cargo.lock generated vendored Normal file
View File

@@ -0,0 +1,807 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
dependencies = [
"memchr",
]
[[package]]
name = "alloca"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"
dependencies = [
"cc",
]
[[package]]
name = "anes"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "anstyle"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
[[package]]
name = "anyhow"
version = "1.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea"
[[package]]
name = "autocfg"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
[[package]]
name = "bitflags"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
[[package]]
name = "cast"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
version = "1.2.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
dependencies = [
"find-msvc-tools",
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "chacha20"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601"
dependencies = [
"cfg-if",
"cpufeatures",
"rand_core",
]
[[package]]
name = "ciborium"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
dependencies = [
"ciborium-io",
"ciborium-ll",
"serde",
]
[[package]]
name = "ciborium-io"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
[[package]]
name = "ciborium-ll"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
dependencies = [
"ciborium-io",
"half",
]
[[package]]
name = "clap"
version = "4.5.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63be97961acde393029492ce0be7a1af7e323e6bae9511ebfac33751be5e6806"
dependencies = [
"clap_builder",
]
[[package]]
name = "clap_builder"
version = "4.5.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f13174bda5dfd69d7e947827e5af4b0f2f94a4a3ee92912fba07a66150f21e2"
dependencies = [
"anstyle",
"clap_lex",
]
[[package]]
name = "clap_lex"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831"
[[package]]
name = "cpufeatures"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
dependencies = [
"libc",
]
[[package]]
name = "criterion"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"
dependencies = [
"alloca",
"anes",
"cast",
"ciborium",
"clap",
"criterion-plot",
"itertools",
"num-traits",
"oorandom",
"page_size",
"regex",
"serde",
"serde_json",
"tinytemplate",
"walkdir",
]
[[package]]
name = "criterion-plot"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"
dependencies = [
"cast",
"itertools",
]
[[package]]
name = "crunchy"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
[[package]]
name = "either"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "find-msvc-tools"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
[[package]]
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "getrandom"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"rand_core",
"wasip2",
"wasip3",
]
[[package]]
name = "half"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
dependencies = [
"cfg-if",
"crunchy",
"zerocopy",
]
[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash",
]
[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
[[package]]
name = "id-arena"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
name = "indexmap"
version = "2.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
dependencies = [
"equivalent",
"hashbrown 0.16.1",
"serde",
"serde_core",
]
[[package]]
name = "itertools"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
[[package]]
name = "leb128fmt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "libc"
version = "0.2.181"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5"
[[package]]
name = "log"
version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
[[package]]
name = "memchr"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
[[package]]
name = "no-panic"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f967505aabc8af5752d098c34146544a43684817cdba8f9725b292530cabbf53"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "num-bigint"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
dependencies = [
"num-integer",
"num-traits",
]
[[package]]
name = "num-integer"
version = "0.1.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
dependencies = [
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
dependencies = [
"hermit-abi",
"libc",
]
[[package]]
name = "oorandom"
version = "11.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "opt-level"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e98329f1048d878d11b28949196b798b93e2f1e0f98121cca55d6b3e1a91030f"
[[package]]
name = "page_size"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
]
[[package]]
name = "proc-macro2"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
dependencies = [
"proc-macro2",
]
[[package]]
name = "r-efi"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8"
dependencies = [
"chacha20",
"getrandom",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba"
[[package]]
name = "regex"
version = "1.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
[[package]]
name = "ryu"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]]
name = "semver"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
[[package]]
name = "serde"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.228"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
dependencies = [
"itoa",
"memchr",
"serde",
"serde_core",
"zmij 1.0.20",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "syn"
version = "2.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tinytemplate"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
dependencies = [
"serde",
"serde_json",
]
[[package]]
name = "unicode-ident"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "walkdir"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
dependencies = [
"same-file",
"winapi-util",
]
[[package]]
name = "wasip2"
version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasip3"
version = "0.4.0+wasi-0.3.0-rc-2026-01-06"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5"
dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasm-encoder"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319"
dependencies = [
"leb128fmt",
"wasmparser",
]
[[package]]
name = "wasm-metadata"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
dependencies = [
"anyhow",
"indexmap",
"wasm-encoder",
"wasmparser",
]
[[package]]
name = "wasmparser"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
"bitflags",
"hashbrown 0.15.5",
"indexmap",
"semver",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-sys"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-link",
]
[[package]]
name = "wit-bindgen"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
dependencies = [
"wit-bindgen-rust-macro",
]
[[package]]
name = "wit-bindgen-core"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
dependencies = [
"anyhow",
"heck",
"wit-parser",
]
[[package]]
name = "wit-bindgen-rust"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
dependencies = [
"anyhow",
"heck",
"indexmap",
"prettyplease",
"syn",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
]
[[package]]
name = "wit-bindgen-rust-macro"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a"
dependencies = [
"anyhow",
"prettyplease",
"proc-macro2",
"quote",
"syn",
"wit-bindgen-core",
"wit-bindgen-rust",
]
[[package]]
name = "wit-component"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"anyhow",
"bitflags",
"indexmap",
"log",
"serde",
"serde_derive",
"serde_json",
"wasm-encoder",
"wasm-metadata",
"wasmparser",
"wit-parser",
]
[[package]]
name = "wit-parser"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
dependencies = [
"anyhow",
"id-arena",
"indexmap",
"log",
"semver",
"serde",
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser",
]
[[package]]
name = "zerocopy"
version = "0.8.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "zmij"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7"
[[package]]
name = "zmij"
version = "1.0.21"
dependencies = [
"criterion",
"no-panic",
"num-bigint",
"num-integer",
"num_cpus",
"opt-level",
"rand",
"ryu",
]

90
vendor/zmij/Cargo.toml vendored Normal file
View File

@@ -0,0 +1,90 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.71"
name = "zmij"
version = "1.0.21"
authors = ["David Tolnay <dtolnay@gmail.com>"]
build = "build.rs"
exclude = ["*.png"]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "A double-to-string conversion algorithm based on Schubfach and yy"
documentation = "https://docs.rs/zmij"
readme = "README.md"
keywords = ["float"]
categories = [
"value-formatting",
"no-std",
"no-std::no-alloc",
]
license = "MIT"
repository = "https://github.com/dtolnay/zmij"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = [
"--generate-link-to-definition",
"--generate-macro-expansion",
"--extern-html-root-url=core=https://doc.rust-lang.org",
]
[lib]
name = "zmij"
path = "src/lib.rs"
[[test]]
name = "exhaustive"
path = "tests/exhaustive.rs"
[[test]]
name = "ryu_comparison"
path = "tests/ryu_comparison.rs"
[[test]]
name = "test"
path = "tests/test.rs"
[[bench]]
name = "bench"
path = "benches/bench.rs"
harness = false
[dependencies.no-panic]
version = "0.1.36"
optional = true
[dev-dependencies.num-bigint]
version = "0.4"
[dev-dependencies.num-integer]
version = "0.1"
[dev-dependencies.num_cpus]
version = "1.8"
[dev-dependencies.opt-level]
version = "1"
[dev-dependencies.rand]
version = "0.10"
[dev-dependencies.ryu]
version = "1"
[target."cfg(not(miri))".dev-dependencies.criterion]
version = "0.8"
default-features = false

23
vendor/zmij/LICENSE-MIT vendored Normal file
View File

@@ -0,0 +1,23 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

42
vendor/zmij/README.md vendored Normal file
View File

@@ -0,0 +1,42 @@
# Żmij
[<img alt="github" src="https://img.shields.io/badge/github-dtolnay/zmij-8da0cb?style=for-the-badge&labelColor=555555&logo=github" height="20">](https://github.com/dtolnay/zmij)
[<img alt="crates.io" src="https://img.shields.io/crates/v/zmij.svg?style=for-the-badge&color=fc8d62&logo=rust" height="20">](https://crates.io/crates/zmij)
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-zmij-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs" height="20">](https://docs.rs/zmij)
[<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/dtolnay/zmij/ci.yml?branch=master&style=for-the-badge" height="20">](https://github.com/dtolnay/zmij/actions?query=branch%3Amaster)
Pure Rust implementation of Żmij, an algorithm to quickly convert floating point
numbers to decimal strings.
This Rust implementation is a line-by-line port of Victor Zverovich's
implementation in C++, [https://github.com/vitaut/zmij][upstream].
[upstream]: https://github.com/vitaut/zmij/tree/b35b64a2ba63da9ea7c0a72fd2651e89743966c9
## Example
```rust
fn main() {
let mut buffer = zmij::Buffer::new();
let printed = buffer.format(1.234);
assert_eq!(printed, "1.234");
}
```
## Performance
The [dtoa-benchmark] compares this library and other Rust floating point
formatting implementations across a range of precisions. The vertical axis in
this chart shows nanoseconds taken by a single execution of
`zmij::Buffer::new().format_finite(value)` so a lower result indicates a faster
library.
[dtoa-benchmark]: https://github.com/dtolnay/dtoa-benchmark
![performance](https://raw.githubusercontent.com/dtolnay/zmij/master/dtoa-benchmark.png)
<br>
#### License
<a href="LICENSE-MIT">MIT license</a>.

47
vendor/zmij/benches/bench.rs vendored Normal file
View File

@@ -0,0 +1,47 @@
#![allow(clippy::unreadable_literal)]
use criterion::{criterion_group, criterion_main, Criterion};
use std::f64;
use std::hint;
use std::io::Write;
fn do_bench(c: &mut Criterion, group_name: &str, float: f64) {
let mut group = c.benchmark_group(group_name);
group.bench_function("zmij", |b| {
let mut buf = zmij::Buffer::new();
b.iter(move || {
let float = hint::black_box(float);
let formatted = buf.format_finite(float);
hint::black_box(formatted);
});
});
group.bench_function("ryu", |b| {
let mut buf = ryu::Buffer::new();
b.iter(move || {
let float = hint::black_box(float);
let formatted = buf.format_finite(float);
hint::black_box(formatted);
});
});
group.bench_function("std::fmt", |b| {
let mut buf = Vec::with_capacity(20);
b.iter(|| {
buf.clear();
let float = hint::black_box(float);
write!(&mut buf, "{float}").unwrap();
hint::black_box(buf.as_slice());
});
});
group.finish();
}
fn bench(c: &mut Criterion) {
do_bench(c, "f64[0]", 0f64);
do_bench(c, "f64[short]", 0.1234f64);
do_bench(c, "f64[medium]", 0.123456789f64);
do_bench(c, "f64[e]", f64::consts::E);
do_bench(c, "f64[max]", f64::MAX);
}
criterion_group!(benches, bench);
criterion_main!(benches);

38
vendor/zmij/build.rs vendored Normal file
View File

@@ -0,0 +1,38 @@
use std::env;
use std::ffi::OsString;
use std::process::{self, Command};
use std::str;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
let rustc = rustc_minor_version().unwrap_or(u32::MAX);
if rustc >= 80 {
println!("cargo:rustc-check-cfg=cfg(exhaustive)");
println!("cargo:rustc-check-cfg=cfg(zmij_no_select_unpredictable)");
}
if rustc < 88 {
// https://doc.rust-lang.org/std/hint/fn.select_unpredictable.html
println!("cargo:rustc-cfg=zmij_no_select_unpredictable");
}
}
fn rustc_minor_version() -> Option<u32> {
let rustc = cargo_env_var("RUSTC");
let output = Command::new(rustc).arg("--version").output().ok()?;
let version = str::from_utf8(&output.stdout).ok()?;
let mut pieces = version.split('.');
if pieces.next() != Some("rustc 1") {
return None;
}
pieces.next()?.parse().ok()
}
fn cargo_env_var(key: &str) -> OsString {
env::var_os(key).unwrap_or_else(|| {
eprintln!("Environment variable ${key} is not set during execution of build script");
process::exit(1);
})
}

7
vendor/zmij/src/hint.rs vendored Normal file
View File

@@ -0,0 +1,7 @@
pub fn select_unpredictable<T>(condition: bool, true_val: T, false_val: T) -> T {
if condition {
true_val
} else {
false_val
}
}

1290
vendor/zmij/src/lib.rs vendored Normal file

File diff suppressed because it is too large Load Diff

65
vendor/zmij/src/stdarch_x86.rs vendored Normal file
View File

@@ -0,0 +1,65 @@
use core::mem;
pub use core::arch::x86_64::*;
pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 {
((z << 6) | (y << 4) | (x << 2) | w) as i32
}
pub const fn _mm_set_epi64x(e1: i64, e0: i64) -> __m128i {
unsafe { mem::transmute([e0, e1]) }
}
pub const fn _mm_set_epi32(e3: i32, e2: i32, e1: i32, e0: i32) -> __m128i {
unsafe { mem::transmute([e0, e1, e2, e3]) }
}
pub const fn _mm_set_epi16(
e7: i16,
e6: i16,
e5: i16,
e4: i16,
e3: i16,
e2: i16,
e1: i16,
e0: i16,
) -> __m128i {
unsafe { mem::transmute([e0, e1, e2, e3, e4, e5, e6, e7]) }
}
pub const fn _mm_set_epi8(
e15: i8,
e14: i8,
e13: i8,
e12: i8,
e11: i8,
e10: i8,
e9: i8,
e8: i8,
e7: i8,
e6: i8,
e5: i8,
e4: i8,
e3: i8,
e2: i8,
e1: i8,
e0: i8,
) -> __m128i {
unsafe {
mem::transmute([
e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15,
])
}
}
pub const fn _mm_set1_epi64x(a: i64) -> __m128i {
_mm_set_epi64x(a, a)
}
pub const fn _mm_set1_epi32(a: i32) -> __m128i {
_mm_set_epi32(a, a, a, a)
}
pub const fn _mm_set1_epi16(a: i16) -> __m128i {
_mm_set_epi16(a, a, a, a, a, a, a, a)
}

75
vendor/zmij/src/tests.rs vendored Normal file
View File

@@ -0,0 +1,75 @@
use core::f64::consts::LOG2_10;
use core::mem;
use num_bigint::BigUint as Uint;
const _: () = {
let static_data =
mem::size_of_val(&crate::POW10_SIGNIFICANDS) + mem::size_of_val(&crate::DIGITS2);
if crate::Pow10SignificandsTable::COMPRESS {
assert!(static_data == 200);
} else {
assert!(static_data == 10120); // 9.9K
}
};
#[cfg(target_endian = "little")]
#[test]
fn utilities() {
let clz = u64::leading_zeros;
assert_eq!(clz(1), 63);
assert_eq!(clz(!0), 0);
assert_eq!(crate::count_trailing_nonzeros(0x00000000_00000000), 0);
assert_eq!(crate::count_trailing_nonzeros(0x00000000_00000001), 1);
assert_eq!(crate::count_trailing_nonzeros(0x00000000_00000009), 1);
assert_eq!(crate::count_trailing_nonzeros(0x00090000_09000000), 7);
assert_eq!(crate::count_trailing_nonzeros(0x01000000_00000000), 8);
assert_eq!(crate::count_trailing_nonzeros(0x09000000_00000000), 8);
}
#[test]
fn umulhi_inexact_to_odd() {
let pow10 = crate::POW10_SIGNIFICANDS.get(-292);
assert_eq!(
crate::umulhi_inexact_to_odd(pow10.hi, pow10.lo, 0x1234567890abcdefu64 << 1),
0x24554a3ce60a45f5,
);
assert_eq!(
crate::umulhi_inexact_to_odd(pow10.hi, pow10.lo, 0x1234567890abce16u64 << 1),
0x24554a3ce60a4643,
);
}
#[test]
fn pow10() {
const DEC_EXP_MIN: i32 = -292;
// Range of decimal exponents [K_min, K_max] from the paper.
let dec_exp_min = -324_i32;
let dec_exp_max = 292_i32;
let num_bits = 128_i32;
// Negate dec_pow_min and dec_pow_max because we need negative powers 10^-k.
for (i, dec_exp) in (-dec_exp_max..=-dec_exp_min).enumerate() {
// dec_exp is -k in the paper.
let bin_exp = (f64::from(dec_exp) * LOG2_10).floor() as i32 - (num_bits - 1);
let bin_pow = Uint::from(2_u8).pow(bin_exp.unsigned_abs());
let dec_pow = Uint::from(10_u8).pow(dec_exp.unsigned_abs());
let result = if dec_exp < 0 {
bin_pow / dec_pow
} else if bin_exp < 0 {
dec_pow * bin_pow
} else {
dec_pow / bin_pow
};
let hi = u64::try_from(&result >> 64).unwrap();
let lo = u64::try_from(result & (Uint::from(2_u8).pow(64) - Uint::from(1_u8))).unwrap();
if !crate::Pow10SignificandsTable::COMPRESS {
assert_eq!(
crate::POW10_SIGNIFICANDS.get(DEC_EXP_MIN + i as i32),
crate::uint128 { hi, lo },
);
}
}
}

83
vendor/zmij/src/traits.rs vendored Normal file
View File

@@ -0,0 +1,83 @@
use core::fmt::Display;
use core::ops::{Add, BitAnd, BitOr, BitOrAssign, BitXorAssign, Div, Mul, Shl, Shr, Sub};
pub trait Float: Copy {
const MANTISSA_DIGITS: u32;
const MIN_10_EXP: i32;
const MAX_10_EXP: i32;
const MAX_DIGITS10: u32;
}
impl Float for f32 {
const MANTISSA_DIGITS: u32 = Self::MANTISSA_DIGITS;
const MIN_10_EXP: i32 = Self::MIN_10_EXP;
const MAX_10_EXP: i32 = Self::MAX_10_EXP;
const MAX_DIGITS10: u32 = 9;
}
impl Float for f64 {
const MANTISSA_DIGITS: u32 = Self::MANTISSA_DIGITS;
const MIN_10_EXP: i32 = Self::MIN_10_EXP;
const MAX_10_EXP: i32 = Self::MAX_10_EXP;
const MAX_DIGITS10: u32 = 17;
}
pub trait UInt:
Copy
+ From<u8>
+ From<bool>
+ Add<Output = Self>
+ Sub<Output = Self>
+ Mul<Output = Self>
+ Div<Output = Self>
+ BitAnd<Output = Self>
+ BitOr<Output = Self>
+ Shl<u8, Output = Self>
+ Shl<i32, Output = Self>
+ Shl<u32, Output = Self>
+ Shr<i32, Output = Self>
+ Shr<u32, Output = Self>
+ BitOrAssign
+ BitXorAssign
+ PartialOrd
+ Into<u64>
+ Display
{
type Signed: Ord;
fn wrapping_sub(self, other: Self) -> Self;
fn truncate(big: u64) -> Self;
fn enlarge(small: u32) -> Self;
fn to_signed(self) -> Self::Signed;
}
impl UInt for u32 {
type Signed = i32;
fn wrapping_sub(self, other: Self) -> Self {
self.wrapping_sub(other)
}
fn truncate(big: u64) -> Self {
big as u32
}
fn enlarge(small: u32) -> Self {
small
}
fn to_signed(self) -> Self::Signed {
self as i32
}
}
impl UInt for u64 {
type Signed = i64;
fn wrapping_sub(self, other: Self) -> Self {
self.wrapping_sub(other)
}
fn truncate(big: u64) -> Self {
big
}
fn enlarge(small: u32) -> Self {
u64::from(small)
}
fn to_signed(self) -> Self::Signed {
self as i64
}
}

View File

View File

@@ -0,0 +1 @@
{"name":"zmij","vers":"1.0.21","deps":[{"name":"no-panic","req":"^0.1.36","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"num-bigint","req":"^0.4","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"num-integer","req":"^0.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"num_cpus","req":"^1.8","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"opt-level","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"rand","req":"^0.10","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"ryu","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false},{"name":"criterion","req":"^0.8","features":[],"optional":false,"default_features":false,"target":"cfg(not(miri))","kind":"dev","registry":"https://github.com/rust-lang/crates.io-index","package":null,"public":null,"artifact":null,"bindep_target":null,"lib":false}],"features":{},"features2":null,"cksum":"515a953cbb04b6c17c95492e20043ba000fc528d654fc40f1e8f9afd6a748084","yanked":null,"links":null,"rust_version":null,"v":2}

Binary file not shown.

Binary file not shown.

58
vendor/zmij/tests/exhaustive.rs vendored Normal file
View File

@@ -0,0 +1,58 @@
#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::Arc;
use std::thread;
#[test]
#[cfg_attr(not(exhaustive), ignore = "requires cfg(exhaustive)")]
fn test_exhaustive() {
const BATCH_SIZE: u32 = 1_000_000;
let counter = Arc::new(AtomicU32::new(0));
let finished = Arc::new(AtomicU32::new(0));
let mut workers = Vec::new();
for _ in 0..num_cpus::get() {
let counter = counter.clone();
let finished = finished.clone();
workers.push(thread::spawn(move || loop {
let batch = counter.fetch_add(1, Ordering::Relaxed);
if batch > u32::MAX / BATCH_SIZE {
return;
}
let min = batch * BATCH_SIZE;
let max = if batch == u32::MAX / BATCH_SIZE {
u32::MAX
} else {
min + BATCH_SIZE - 1
};
let mut zmij_buffer = zmij::Buffer::new();
let mut ryu_buffer = ryu::Buffer::new();
for u in min..=max {
let f = f32::from_bits(u);
if !f.is_finite() {
continue;
}
let zmij = zmij_buffer.format_finite(f);
assert_eq!(Ok(f), zmij.parse());
let ryu = ryu_buffer.format_finite(f);
let matches = if ryu.contains('e') && !ryu.contains("e-") {
ryu.split_once('e') == zmij.split_once("e+")
} else {
ryu == zmij
};
assert!(matches, "{ryu} != {zmij}");
}
let increment = max - min + 1;
let update = finished.fetch_add(increment, Ordering::Relaxed);
println!("{}", u64::from(update) + u64::from(increment));
}));
}
for w in workers {
w.join().unwrap();
}
}

36
vendor/zmij/tests/ryu_comparison.rs vendored Normal file
View File

@@ -0,0 +1,36 @@
use rand::rngs::{SmallRng, SysRng};
use rand::{Rng as _, SeedableRng as _};
const N: usize = if cfg!(miri) {
500
} else if let b"0" = opt_level::OPT_LEVEL.as_bytes() {
1_000_000
} else {
100_000_000
};
#[test]
fn ryu_comparison() {
let mut ryu_buffer = ryu::Buffer::new();
let mut zmij_buffer = zmij::Buffer::new();
let mut rng = SmallRng::try_from_rng(&mut SysRng).unwrap();
let mut fail = 0;
for _ in 0..N {
let bits = rng.next_u64();
let float = f64::from_bits(bits);
let ryu = ryu_buffer.format(float);
let zmij = zmij_buffer.format(float);
let matches = if ryu.contains('e') && !ryu.contains("e-") {
ryu.split_once('e') == zmij.split_once("e+")
} else {
ryu == zmij
};
if !matches {
eprintln!("RYU={ryu} ZMIJ={zmij}");
fail += 1;
}
}
assert!(fail == 0, "{fail} mismatches");
}

121
vendor/zmij/tests/test.rs vendored Normal file
View File

@@ -0,0 +1,121 @@
#![allow(clippy::float_cmp, clippy::unreadable_literal)]
fn dtoa(value: f64) -> String {
zmij::Buffer::new().format(value).to_owned()
}
fn ftoa(value: f32) -> String {
zmij::Buffer::new().format(value).to_owned()
}
mod dtoa_test {
use super::dtoa;
#[test]
fn normal() {
assert_eq!(dtoa(6.62607015e-34), "6.62607015e-34");
// Exact half-ulp tie when rounding to nearest integer.
assert_eq!(dtoa(5.444310685350916e+14), "544431068535091.6");
}
#[test]
fn subnormal() {
assert_eq!(dtoa(0.0f64.next_up()), "5e-324");
assert_eq!(dtoa(1e-323), "1e-323");
assert_eq!(dtoa(1.2e-322), "1.2e-322");
assert_eq!(dtoa(1.24e-322), "1.24e-322");
assert_eq!(dtoa(1.234e-320), "1.234e-320");
}
#[test]
fn all_irregular() {
for exp in 1..0x3ff {
let bits = exp << 52;
let value = f64::from_bits(bits);
assert_eq!(dtoa(value), ryu::Buffer::new().format(value));
}
}
#[test]
fn all_exponents() {
for exp in 0..=0x3ff {
let bits = (exp << 52) | 1;
let value = f64::from_bits(bits);
assert_eq!(dtoa(value), ryu::Buffer::new().format(value));
}
}
#[test]
fn small_int() {
assert_eq!(dtoa(1.0), "1.0");
}
#[test]
fn zero() {
assert_eq!(dtoa(0.0), "0.0");
assert_eq!(dtoa(-0.0), "-0.0");
}
#[test]
fn inf() {
assert_eq!(dtoa(f64::INFINITY), "inf");
}
#[test]
fn nan() {
assert_eq!(dtoa(f64::NAN.copysign(-1.0)), "NaN");
}
#[test]
fn shorter() {
// A possibly shorter underestimate is picked (u' in Schubfach).
assert_eq!(dtoa(-4.932096661796888e-226), "-4.932096661796888e-226");
// A possibly shorter overestimate is picked (w' in Schubfach).
assert_eq!(dtoa(3.439070283483335e+35), "3.439070283483335e+35");
}
#[test]
fn single_candidate() {
// Only an underestimate is in the rounding region (u in Schubfach).
assert_eq!(dtoa(6.606854224493745e-17), "6.606854224493745e-17");
// Only an overestimate is in the rounding region (w in Schubfach).
assert_eq!(dtoa(6.079537928711555e+61), "6.079537928711555e+61");
}
#[test]
fn null_terminated() {
assert_eq!(dtoa(9.061488e15), "9061488000000000.0");
assert_eq!(dtoa(f64::NAN.copysign(1.0)), "NaN");
}
#[test]
fn no_buffer() {
assert_eq!(dtoa(6.62607015e-34), "6.62607015e-34");
}
}
mod ftoa_test {
use super::ftoa;
#[test]
fn normal() {
assert_eq!(ftoa(6.62607e-34), "6.62607e-34");
assert_eq!(ftoa(1.342178e+08), "134217800.0");
assert_eq!(ftoa(1.3421781e+08), "134217810.0");
}
#[test]
fn subnormal() {
assert_eq!(ftoa(0.0f32.next_up()), "1e-45");
}
#[test]
fn no_buffer() {
assert_eq!(ftoa(6.62607e-34), "6.62607e-34");
}
}