From cb519b8213bd864334dd70d8c5b914463167d91f Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 31 Jul 2026 09:10:40 +0000 Subject: [PATCH] Update the crates, mainly syn --- Cargo.lock | 512 ++++++---------------------- Justfile | 1 + examples/Cargo.lock | 395 +++------------------ examples/example_fuzzer/Cargo.toml | 2 +- examples/example_fuzzer/src/main.rs | 20 +- lain/Cargo.toml | 9 +- lain/src/mutator.rs | 6 +- lain_derive/Cargo.toml | 9 +- lain_derive/src/dummy.rs | 2 +- lain_derive/src/internals/ast.rs | 14 +- lain_derive/src/internals/attr.rs | 270 +++++++-------- lain_derive/src/lib.rs | 4 +- lain_derive/src/mutations.rs | 9 +- lain_derive/src/serialize.rs | 15 +- 14 files changed, 317 insertions(+), 951 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 075f719..074c908 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,23 +32,11 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - [[package]] name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "bitflags" -version = "2.8.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "byteorder" @@ -64,9 +52,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.60" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" +checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9" dependencies = [ "find-msvc-tools", "shlex", @@ -74,15 +62,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" dependencies = [ "cfg-if", "cpufeatures", @@ -118,18 +106,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.1" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +checksum = "d91e0c145792ef73a6ad36d27c75ac09f1832222a3c209689d90f534685ee5b7" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b" dependencies = [ "anstyle", "clap_lex", @@ -191,15 +179,9 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "either" -version = "1.11.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" [[package]] name = "field-offset" @@ -217,24 +199,16 @@ 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.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", "r-efi", "rand_core", - "wasip2", - "wasip3", ] [[package]] @@ -248,45 +222,6 @@ dependencies = [ "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.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[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.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.0", - "serde", - "serde_core", -] - [[package]] name = "itertools" version = "0.13.0" @@ -298,9 +233,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "lain" @@ -325,9 +260,9 @@ version = "0.5.7" dependencies = [ "byteorder", "log", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "quote", + "syn 3.0.3", ] [[package]] @@ -336,29 +271,23 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[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.185" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "memchr" -version = "2.7.2" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memoffset" @@ -385,9 +314,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" dependencies = [ "num-integer", "num-traits", @@ -404,13 +333,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "e4e98dc3b890f6c23a0f9d3d491a2823d0dea0fa656302a13dd225fa924112a8" dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", - "syn 2.0.117", + "proc-macro2", + "quote", + "syn 3.0.3", ] [[package]] @@ -424,11 +353,10 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -475,50 +403,22 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2 1.0.106", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "0.6.13" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2 1.0.106", + "proc-macro2", ] [[package]] @@ -529,9 +429,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" dependencies = [ "chacha20", "getrandom", @@ -546,9 +446,9 @@ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "regex" -version = "1.12.3" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ "aho-corasick", "memchr", @@ -558,9 +458,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" dependencies = [ "aho-corasick", "memchr", @@ -569,25 +469,19 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[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", ] -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - [[package]] name = "same-file" version = "1.0.6" @@ -599,15 +493,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -615,60 +509,62 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", - "syn 2.0.117", + "proc-macro2", + "quote", + "syn 3.0.3", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "itoa", - "ryu", + "memchr", "serde", + "serde_core", + "zmij", ] [[package]] name = "shlex" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] name = "syn" -version = "0.15.44" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] name = "syn" -version = "2.0.117" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", + "proc-macro2", + "quote", "unicode-ident", ] @@ -692,21 +588,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.6" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "walkdir" @@ -718,58 +602,6 @@ dependencies = [ "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" @@ -788,9 +620,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ "windows-sys", ] @@ -802,182 +634,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" +name = "windows-link" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[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 2.0.117", - "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 1.0.106", - "quote 1.0.45", - "syn 2.0.117", - "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" +name = "windows-sys" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid 0.2.6", - "wasmparser", + "windows-link", ] [[package]] name = "zerocopy" -version = "0.8.48" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.48" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", - "syn 2.0.117", + "proc-macro2", + "quote", + "syn 2.0.119", ] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Justfile b/Justfile index 83f2668..1545056 100644 --- a/Justfile +++ b/Justfile @@ -8,6 +8,7 @@ default: # Check code formatting and lints clippy: cargo clippy --workspace --all-targets -- -D warnings + cargo clippy --manifest-path examples/Cargo.toml --all-targets -- -D warnings # Format codebase (Rust, TOML, YAML, Markdown, Justfile) fmt: diff --git a/examples/Cargo.lock b/examples/Cargo.lock index 83dbcd3..9f20e72 100644 --- a/examples/Cargo.lock +++ b/examples/Cargo.lock @@ -2,23 +2,17 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "bitflags" -version = "2.11.1" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" [[package]] name = "block2" @@ -43,15 +37,15 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" [[package]] name = "chacha20" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" dependencies = [ "cfg-if", "cpufeatures", @@ -90,12 +84,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - [[package]] name = "example_fuzzer" version = "0.1.0" @@ -114,71 +102,18 @@ dependencies = [ "rustc_version", ] -[[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.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", "r-efi", "rand_core", - "wasip2", - "wasip3", -] - -[[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.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[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.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.0", - "serde", - "serde_core", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - [[package]] name = "lain" version = "0.5.7" @@ -201,9 +136,9 @@ version = "0.5.7" dependencies = [ "byteorder", "log", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.39", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -212,29 +147,17 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[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.185" +version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" [[package]] name = "log" -version = "0.4.29" +version = "0.4.33" 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" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "memoffset" @@ -247,9 +170,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.31.2" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ "bitflags", "cfg-if", @@ -273,9 +196,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" dependencies = [ "num-integer", "num-traits", @@ -292,13 +215,13 @@ dependencies = [ [[package]] name = "num-derive" -version = "0.4.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "e4e98dc3b890f6c23a0f9d3d491a2823d0dea0fa656302a13dd225fa924112a8" dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", - "syn 2.0.117", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -312,11 +235,10 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -362,50 +284,22 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2 1.0.106", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.45" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ - "proc-macro2 1.0.106", + "proc-macro2", ] [[package]] @@ -416,9 +310,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" dependencies = [ "chacha20", "getrandom", @@ -446,67 +340,14 @@ version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", -] - -[[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 1.0.106", - "quote 1.0.45", - "syn 2.0.117", -] - -[[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", -] - [[package]] name = "syn" -version = "0.15.39" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2 1.0.106", - "quote 1.0.45", + "proc-macro2", + "quote", "unicode-ident", ] @@ -516,70 +357,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[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 = "windows-link" version = "0.2.1" @@ -594,97 +371,3 @@ 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 2.0.117", - "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 1.0.106", - "quote 1.0.45", - "syn 2.0.117", - "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 0.2.6", - "wasmparser", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/examples/example_fuzzer/Cargo.toml b/examples/example_fuzzer/Cargo.toml index 5794f91..6dae2a9 100644 --- a/examples/example_fuzzer/Cargo.toml +++ b/examples/example_fuzzer/Cargo.toml @@ -6,4 +6,4 @@ edition = "2018" [dependencies] lain = { path = "../../lain" } -ctrlc = "3.4.5" +ctrlc = "3.5.2" diff --git a/examples/example_fuzzer/src/main.rs b/examples/example_fuzzer/src/main.rs index ece3c01..3e03e04 100644 --- a/examples/example_fuzzer/src/main.rs +++ b/examples/example_fuzzer/src/main.rs @@ -1,13 +1,11 @@ -#![feature(specialization)] +#![feature(min_specialization)] -extern crate lain; extern crate ctrlc; +extern crate lain; +use lain::driver::*; use lain::prelude::*; use lain::rand::Rng; -// the driver is optional -- you can figure out how to manage -// your fuzzer's threads -use lain::driver::*; use std::io::prelude::*; use std::net::TcpStream; @@ -18,7 +16,6 @@ const THREAD_COUNT: usize = 10; #[derive(Default)] struct FuzzerThreadContext { last_packet: Option, - scratch_packet: PacketData, thread_packet_iterations: usize, } @@ -40,25 +37,20 @@ struct PacketData { } impl Fixup for PacketData { - fn fixup(&mut self, mutator: &mut Mutator) { + fn fixup(&mut self, _mutator: &mut Mutator) { self.length = self.data.len() as u64; } } -#[derive(Debug, Copy, Clone, FuzzerObject, ToPrimitiveU32, BinarySerialize)] +#[derive(Debug, Copy, Clone, FuzzerObject, ToPrimitiveU32, BinarySerialize, Default)] #[repr(u32)] enum PacketType { + #[default] Read = 0x0, Write = 0x1, Reset = 0x2, } -impl Default for PacketType { - fn default() -> Self { - PacketType::Read - } -} - fn main() { let mut driver = FuzzerDriver::::new(THREAD_COUNT); diff --git a/lain/Cargo.toml b/lain/Cargo.toml index 3b01884..d03a833 100644 --- a/lain/Cargo.toml +++ b/lain/Cargo.toml @@ -9,18 +9,19 @@ keywords.workspace = true license.workspace = true [dependencies] -rand = { version = "0.10.1" } +rand = { version = "0.10.2" } byteorder = "1.5.0" paste = "1.0.15" lain_derive = { version = "0.5.7", path = "../lain_derive" } -log = "0.4.29" +log = "0.4.33" num-traits = "0.2.19" -num-derive = "0.4.2" +num-derive = "0.5.1" num = "0.4.3" lazy_static = "1.5.0" -serde = { version = "1.0.228", optional = true, features = ["derive"] } +serde = { version = "1.0.229", optional = true, features = ["derive"] } field-offset = "0.3.6" + [features] default_features = [] serde_support = ["serde"] diff --git a/lain/src/mutator.rs b/lain/src/mutator.rs index 809a086..ecea008 100644 --- a/lain/src/mutator.rs +++ b/lain/src/mutator.rs @@ -208,7 +208,7 @@ impl Mutator { if min >= max { panic!("cannot gen number where min ({}) >= max ({})", min, max); } - trace!("generating number between {} and {}", &min, &max); + trace!("generating number between {} and {}", min, max); let num = self.rng.random_range(min..max); trace!("got {}", num); @@ -246,8 +246,8 @@ impl Mutator { trace!( "generating weighted number between {} and {} with weight towards {:?}", - &min, - &max, + min, + max, weighted ); diff --git a/lain_derive/Cargo.toml b/lain_derive/Cargo.toml index eed994e..4ed23d3 100644 --- a/lain_derive/Cargo.toml +++ b/lain_derive/Cargo.toml @@ -9,11 +9,12 @@ keywords.workspace = true license.workspace = true [dependencies] -syn = { version = "0.15", features = ["extra-traits"] } -quote = "0.6" -proc-macro2 = "0.4" +syn = { version = "3.0", features = ["extra-traits"] } +quote = "1.0" +proc-macro2 = "1.0" byteorder = "1.5.0" -log = "0.4.29" +log = "0.4.33" + [lib] proc-macro = true diff --git a/lain_derive/src/dummy.rs b/lain_derive/src/dummy.rs index 37e8111..566e4ca 100644 --- a/lain_derive/src/dummy.rs +++ b/lain_derive/src/dummy.rs @@ -13,7 +13,7 @@ pub fn wrap_in_const(_trait_: &str, _ty: &Ident, code: TokenStream) -> TokenStre }; quote! { - #[allow(clippy)] + #[allow(clippy::all)] #[allow(unknown_lints)] #[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] const #dummy_const: () = { diff --git a/lain_derive/src/internals/ast.rs b/lain_derive/src/internals/ast.rs index 449afd0..d0317a6 100644 --- a/lain_derive/src/internals/ast.rs +++ b/lain_derive/src/internals/ast.rs @@ -136,21 +136,19 @@ fn fields_from_ast<'a>(cx: &Ctxt, fields: &'a Punctuated) field.attrs.set_bit_shift(bitfield_bits); bitfield_bits += bits; - let bits_in_type: usize; - let bitfield_type = field.attrs.bitfield_type().unwrap_or(field.ty); - if is_primitive_type(bitfield_type, "u8") { - bits_in_type = 8 + let bits_in_type: usize = if is_primitive_type(bitfield_type, "u8") { + 8 } else if is_primitive_type(bitfield_type, "u16") { - bits_in_type = 16 + 16 } else if is_primitive_type(bitfield_type, "u32") { - bits_in_type = 32 + 32 } else if is_primitive_type(bitfield_type, "u64") { - bits_in_type = 64 + 64 } else { cx.error_spanned_by(field.ty, "Unsupported bitfield datatype. Did you forget to specify `#[lain(bitfield_type = \"...\")]`?"); return field; - } + }; if bitfield_bits == bits_in_type { bitfield_bits = 0; diff --git a/lain_derive/src/internals/attr.rs b/lain_derive/src/internals/attr.rs index 946f348..48c33b9 100644 --- a/lain_derive/src/internals/attr.rs +++ b/lain_derive/src/internals/attr.rs @@ -5,12 +5,9 @@ use quote::{quote, quote_spanned, ToTokens}; use std::borrow::Cow; use std::str::FromStr; use syn::parse::{self, Parse}; -use syn::spanned::Spanned; use syn::Lit::{Float, Int}; -use syn::Meta::{List, NameValue, Word}; -use syn::NestedMeta::{Literal, Meta}; use syn::{self, parse_quote}; -use syn::{Ident, IntSuffix, LitInt}; +use syn::{Ident, LitInt}; pub struct Attr<'c, T> { cx: &'c Ctxt, @@ -74,38 +71,49 @@ impl Container { let mut serialized_size = Attr::none(cx, SERIALIZED_SIZE); let mut min_serialized_size = Attr::none(cx, MIN_SERIALIZED_SIZE); - for meta_items in item.attrs.iter().filter_map(get_lain_meta_items) { - for meta_item in meta_items { - match meta_item { - Meta(NameValue(ref m)) if m.ident == SERIALIZED_SIZE => { - if let Int(ref i) = m.lit { - serialized_size.set(&m.ident, i.value() as usize); + for attr in &item.attrs { + if *attr.path() == LAIN { + if let Err(err) = attr.parse_nested_meta(|meta| { + if meta.path == SERIALIZED_SIZE { + let value = meta.value()?; + let i: LitInt = value.parse()?; + if let Ok(val) = i.base10_parse::() { + serialized_size.set(&meta.path, val); } else { cx.error_spanned_by( - &m.lit, - format!("failed to integer expression for {}", SERIALIZED_SIZE), + &i, + format!( + "failed to parse integer expression for {}", + SERIALIZED_SIZE + ), ); } - } - Meta(NameValue(ref m)) if m.ident == MIN_SERIALIZED_SIZE => { - if let Int(ref i) = m.lit { - min_serialized_size.set(&m.ident, i.value() as usize); + } else if meta.path == MIN_SERIALIZED_SIZE { + let value = meta.value()?; + let i: LitInt = value.parse()?; + if let Ok(val) = i.base10_parse::() { + min_serialized_size.set(&meta.path, val); } else { cx.error_spanned_by( - &m.lit, - format!("failed to integer expression for {}", MIN_SERIALIZED_SIZE), + &i, + format!( + "failed to parse integer expression for {}", + MIN_SERIALIZED_SIZE + ), ); } - } - Meta(ref meta_item) => { + } else { cx.error_spanned_by( - meta_item.name(), - format!("unknown lain container attribute `{}`", meta_item.name()), + &meta.path, + format!( + "unknown lain container attribute `{}`", + meta.path.to_token_stream() + ), ); } - Literal(ref lit) => { - cx.error_spanned_by(lit, "unexpected literal in lain container attribute"); - } + Ok(()) + }) { + cx.error_spanned_by(attr, err.to_string()); } } } @@ -180,122 +188,125 @@ impl Field { let mut little_endian = BoolAttr::none(cx, LITTLE_ENDIAN); let mut weight_to = Attr::none(cx, WEIGHT_TO); - for meta_items in field.attrs.iter().filter_map(get_lain_meta_items) { - for meta_item in meta_items { - match meta_item { - // `#[lain(min = 3)]` - Meta(NameValue(ref m)) if m.ident == MIN => { - if let Ok(t) = parse_min_max(cx, MIN, &m.lit) { - min.set(&m.ident, t); + for attr in &field.attrs { + if *attr.path() == LAIN { + if let Err(err) = attr.parse_nested_meta(|meta| { + if meta.path == MIN { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Ok(t) = parse_min_max(cx, MIN, &lit) { + min.set(&meta.path, t); } - } - // `#[lain(max = 3)]` - Meta(NameValue(ref m)) if m.ident == MAX => { - if let Ok(t) = parse_min_max(cx, MAX, &m.lit) { - max.set(&m.ident, t); + } else if meta.path == MAX { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Ok(t) = parse_min_max(cx, MAX, &lit) { + max.set(&meta.path, t); } - } - // `#[lain(bits = 3)]` - Meta(NameValue(ref m)) if m.ident == BITS => { - if let Int(ref i) = m.lit { - bits.set(&m.ident, i.value() as usize); + } else if meta.path == BITS { + let value = meta.value()?; + let i: LitInt = value.parse()?; + if let Ok(val) = i.base10_parse::() { + bits.set(&meta.path, val); } else { cx.error_spanned_by( - &m.lit, + &i, format!("failed to parse integer expression for `{}`", BITS), ); } - } - // `#[lain(bitfield_type = "u8")]` - Meta(NameValue(ref m)) if m.ident == BITFIELD_TYPE => { - if let Ok(expr) = parse_lit_into_type(cx, BITFIELD_TYPE, &m.lit) { - bitfield_type.set(&m.ident, expr) + } else if meta.path == BITFIELD_TYPE { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Ok(expr) = parse_lit_into_type(cx, BITFIELD_TYPE, &lit) { + bitfield_type.set(&meta.path, expr); } else { cx.error_spanned_by( - &m.lit, + &lit, format!("failed to parse `{}` into a type", BITFIELD_TYPE), ); } - } - // `#[lain(big_endian)]` - Meta(Word(ref word)) if word == BIG_ENDIAN => { + } else if meta.path == BIG_ENDIAN { if little_endian.get() { cx.error_spanned_by( - word, + &meta.path, format!( "attribute meta items `{}` and `{}` are mutually exclusive", BIG_ENDIAN, LITTLE_ENDIAN ), ); } else { - big_endian.set_true(word); + big_endian.set_true(&meta.path); } - } - // `#[lain(little_endian)]` - Meta(Word(ref word)) if word == LITTLE_ENDIAN => { + } else if meta.path == LITTLE_ENDIAN { if big_endian.get() { cx.error_spanned_by( - word, + &meta.path, format!( "attribute meta items `{}` and `{}` are mutually exclusive", BIG_ENDIAN, LITTLE_ENDIAN ), ); } else { - little_endian.set_true(word); + little_endian.set_true(&meta.path); } - } - // `#[lain(ignore)]` - Meta(Word(ref word)) if word == IGNORE => { - ignore.set_true(word); - } - // `#[lain(ignore_chance = 99.0)]` - Meta(NameValue(ref m)) if m.ident == IGNORE_CHANCE => { - if let Float(ref f) = m.lit { - ignore_chance.set(&m.ident, f.value()); - } else if let Int(ref i) = m.lit { - ignore_chance.set(&m.ident, i.value() as f64); + } else if meta.path == IGNORE { + ignore.set_true(&meta.path); + } else if meta.path == IGNORE_CHANCE { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Float(ref f) = lit { + if let Ok(val) = f.base10_parse::() { + ignore_chance.set(&meta.path, val); + } + } else if let Int(ref i) = lit { + if let Ok(val) = i.base10_parse::() { + ignore_chance.set(&meta.path, val); + } } else { cx.error_spanned_by( - &m.lit, + &lit, format!("failed to parse float expression for `{}`", IGNORE_CHANCE), ); } - } - Meta(NameValue(ref m)) if m.ident == INITIALIZER => { - if let Ok(s) = get_lit_str(cx, INITIALIZER, INITIALIZER, &m.lit) { + } else if meta.path == INITIALIZER { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Ok(s) = get_lit_str(cx, INITIALIZER, INITIALIZER, &lit) { if let Ok(tokens) = TokenStream::from_str(&s.value()) { - initializer.set(&m.ident, tokens); + initializer.set(&meta.path, tokens); } else { cx.error_spanned_by( - &m.lit, + &lit, format!("failed to parse tokens for `{}`", INITIALIZER), - ) + ); } } - } - Meta(NameValue(ref m)) if m.ident == WEIGHT_TO => { - if let Ok(s) = get_lit_str(cx, WEIGHT_TO, WEIGHT_TO, &m.lit) { + } else if meta.path == WEIGHT_TO { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Ok(s) = get_lit_str(cx, WEIGHT_TO, WEIGHT_TO, &lit) { match s.value().as_ref() { - "min" => weight_to.set(&m.ident, WeightTo::Min), - "max" => weight_to.set(&m.ident, WeightTo::Max), - "none" => weight_to.set(&m.ident, WeightTo::None), + "min" => weight_to.set(&meta.path, WeightTo::Min), + "max" => weight_to.set(&meta.path, WeightTo::Max), + "none" => weight_to.set(&meta.path, WeightTo::None), _ => cx.error_spanned_by( - &m.lit, - format!("unknown option `{}` for `{}`", WEIGHT_TO, m.ident), + &lit, + format!("unknown option `{}` for `{}`", s.value(), WEIGHT_TO), ), } } - } - Meta(ref meta_item) => { + } else { cx.error_spanned_by( - meta_item.name(), - format!("unknown lain field attribute `{}`", meta_item.name()), + &meta.path, + format!( + "unknown lain field attribute `{}`", + meta.path.to_token_stream() + ), ); } - Literal(ref lit) => { - cx.error_spanned_by(lit, "unexpected literal in lain field attribute"); - } + Ok(()) + }) { + cx.error_spanned_by(attr, err.to_string()); } } } @@ -387,46 +398,51 @@ impl Variant { let mut ignore = BoolAttr::none(cx, IGNORE); let mut ignore_chance = Attr::none(cx, IGNORE_CHANCE); - for meta_items in variant.attrs.iter().filter_map(get_lain_meta_items) { - for meta_item in meta_items { - match meta_item { - // `#[lain(weight = 3)]` - Meta(NameValue(ref m)) if m.ident == WEIGHT => { - if let Int(ref i) = m.lit { - weight.set(&m.ident, i.value()); + for attr in &variant.attrs { + if *attr.path() == LAIN { + if let Err(err) = attr.parse_nested_meta(|meta| { + if meta.path == WEIGHT { + let value = meta.value()?; + let i: LitInt = value.parse()?; + if let Ok(val) = i.base10_parse::() { + weight.set(&meta.path, val); } else { cx.error_spanned_by( - &m.lit, + &i, format!("failed to parse integer expression for {}", WEIGHT), ); } - } - // `#[lain(ignore)]` - Meta(Word(ref word)) if word == IGNORE => { - ignore.set_true(word); - } - // `#[lain(ignore_chance = 99.0)]` - Meta(NameValue(ref m)) if m.ident == IGNORE_CHANCE => { - if let Float(ref f) = m.lit { - ignore_chance.set(&m.ident, f.value()); - } else if let Int(ref i) = m.lit { - ignore_chance.set(&m.ident, i.value() as f64); + } else if meta.path == IGNORE { + ignore.set_true(&meta.path); + } else if meta.path == IGNORE_CHANCE { + let value = meta.value()?; + let lit: syn::Lit = value.parse()?; + if let Float(ref f) = lit { + if let Ok(val) = f.base10_parse::() { + ignore_chance.set(&meta.path, val); + } + } else if let Int(ref i) = lit { + if let Ok(val) = i.base10_parse::() { + ignore_chance.set(&meta.path, val); + } } else { cx.error_spanned_by( - &m.lit, + &lit, format!("failed to parse float expression for `{}`", IGNORE_CHANCE), ); } - } - Meta(ref meta_item) => { + } else { cx.error_spanned_by( - meta_item.name(), - format!("unknown lain variant attribute `{}`", meta_item.name()), + &meta.path, + format!( + "unknown lain variant attribute `{}`", + meta.path.to_token_stream() + ), ); } - Literal(ref lit) => { - cx.error_spanned_by(lit, "unexpected literal in lain variant attribute"); - } + Ok(()) + }) { + cx.error_spanned_by(attr, err.to_string()); } } } @@ -451,20 +467,6 @@ impl Variant { } } -pub fn get_lain_meta_items(attr: &syn::Attribute) -> Option> { - if attr.path == LAIN { - match attr.interpret_meta() { - Some(List(ref meta)) => Some(meta.nested.iter().cloned().collect()), - _ => { - // TODO: produce an error - None - } - } - } else { - None - } -} - pub fn get_lit_str<'a>( cx: &Ctxt, attr_name: Symbol, @@ -499,7 +501,7 @@ fn parse_min_max(cx: &Ctxt, attr_name: Symbol, lit: &syn::Lit) -> Result #int}) } else { Ok(quote_spanned! {lit.span() => #lit}) diff --git a/lain_derive/src/lib.rs b/lain_derive/src/lib.rs index 89ecca3..464160f 100644 --- a/lain_derive/src/lib.rs +++ b/lain_derive/src/lib.rs @@ -237,8 +237,8 @@ fn variable_size_object_helper(input: &DeriveInput) -> TokenStream { let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); quote! { - #[allow(clippy)] #[allow(unknown_lints)] + #[automatically_derived] impl #impl_generics ::lain::traits::VariableSizeObject for #name #ty_generics #where_clause { fn is_variable_size() -> bool { #imp @@ -299,8 +299,8 @@ fn to_primitive_of_type( let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); let expanded = quote! { - #[allow(clippy)] #[allow(unknown_lints)] + #[automatically_derived] impl #impl_generics ::lain::traits::ToPrimitive for #name #ty_generics #where_clause { type Output = #ty; diff --git a/lain_derive/src/mutations.rs b/lain_derive/src/mutations.rs index 0cac0ab..5f58d26 100644 --- a/lain_derive/src/mutations.rs +++ b/lain_derive/src/mutations.rs @@ -26,7 +26,6 @@ pub fn expand_mutatable(input: &syn::DeriveInput) -> Result Result TokenStream { if let Some(bits) = attrs.bits() { // TODO: maybe refactor attributes so that they can retain original span - let bitfield_max = syn::LitInt::new( - 2_u64.pow(bits as u32), - syn::IntSuffix::None, - Span::call_site(), - ); + let bitfield_max = + syn::LitInt::new(&2_u64.pow(bits as u32).to_string(), Span::call_site()); max = quote! {Some(#bitfield_max)}; min = quote! {Some(0)}; } else { diff --git a/lain_derive/src/serialize.rs b/lain_derive/src/serialize.rs index c1d21aa..58fb64f 100644 --- a/lain_derive/src/serialize.rs +++ b/lain_derive/src/serialize.rs @@ -1,7 +1,6 @@ use proc_macro2::TokenStream; -use quote::{quote, quote_spanned}; +use quote::{quote, quote_spanned, ToTokens}; use std::str::FromStr; -use syn::export::quote::ToTokens; use syn::spanned::Spanned; use crate::dummy; @@ -52,7 +51,6 @@ pub fn expand_binary_serialize(input: &syn::DeriveInput) -> Result Result { let min = field.attrs.min().unwrap(); - quote_spanned! { field.original.span() => <#ty>::min_nonzero_elements_size() * #min } + if min.to_string() == "0" { + quote_spanned! { field.original.span() => 0usize } + } else { + quote_spanned! { field.original.span() => <#ty>::min_nonzero_elements_size() * #min } + } } _ => { quote_spanned! { field.original.span() => (<#ty>::min_nonzero_elements_size() ) }