From 3a2bf7d26193f5a9d79084d827a94d6c1ddea757 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Mon, 23 Nov 2026 09:53:11 -0500 Subject: [PATCH 1/3] update to typespace 0.1.4 and lower the MSRV to 1.88 --- .github/workflows/rust.yml | 4 +- CHANGELOG.adoc | 5 + Cargo.lock | 580 ++++++++++++++++++++++++++++++++++--- Cargo.toml | 4 +- 4 files changed, 543 insertions(+), 50 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c9ca9c36..b5e914ab 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -72,14 +72,14 @@ jobs: # rust-toolchain.toml, so this job really uses the MSRV compiler. # Without it the job silently builds with the pinned toolchain and # proves nothing. - RUSTUP_TOOLCHAIN: "1.97" + RUSTUP_TOOLCHAIN: "1.88" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable with: # Keep "1.97" (here and in RUSTUP_TOOLCHAIN above) in sync with # rust-version in Cargo.toml. - toolchain: "1.97" + toolchain: "1.88" - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 with: key: msrv diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index aa841d86..cf2f8054 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -16,6 +16,11 @@ https://github.com/oxidecomputer/typify/compare/v0.10.1\...HEAD[Full list of commits] * Handle the `const` keyword (#1115) +* Lower the MSRV to 1.88, matching typespace 0.1.4. +* A newtype with a schema `default` gets its `Default` impl back, as in 0.8 + (typespace #74). +* A default on a constrained newtype that the generated `TryFrom` would refuse + now fails generation instead of being baked into the output (typespace #77). == 0.10.1 (released 2026-11-16) diff --git a/Cargo.lock b/Cargo.lock index c52cc4c2..33aa5475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,20 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -26,6 +40,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -138,12 +158,33 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bit-set" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + [[package]] name = "bitflags" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "borrow-or-share" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0b364ead1874514c8c2855ab558056ebfeb775653e7ae45ff72f28f8f3166c" + [[package]] name = "bstr" version = "1.8.0" @@ -161,6 +202,12 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + [[package]] name = "cargo-typify" version = "0.10.1" @@ -251,9 +298,9 @@ checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "codespace" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad2220b174fd87f25c53717f0cfd18eb43b9cb69c67ca43176d3e9c50865a08" +checksum = "3fe87f160f5303bc192fa0f89b1916a72e4fe9b0a3390902821e1d68774230a0" dependencies = [ "proc-macro2", "quote", @@ -313,6 +360,12 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "data-encoding" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" + [[package]] name = "difflib" version = "0.4.0" @@ -325,6 +378,15 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +[[package]] +name = "email_address" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab6bbd053d3cdc62ba3de82aae11530a97bbd5b3a572fbdbcd0f0e545e3ff21" +dependencies = [ + "serde", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -413,18 +475,94 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fancy-regex" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a2e16b9a584b602f1e0e5e22c30ca0906786088c27500653e432d086def8b53" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + [[package]] name = "fastrand" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +[[package]] +name = "fluent-uri" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc74ac4d8359ae70623506d512209619e5cf8f347124910440dbc221714b328e" +dependencies = [ + "borrow-or-share", + "ref-cast", + "serde", +] + [[package]] name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "fraction" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e246562084dde8ebbcc943b261c406ce4f68e5032ec28029a251a47d6a295500" +dependencies = [ + "num", + "num-bigint", +] + +[[package]] +name = "futures-core" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" + +[[package]] +name = "futures-task" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" + +[[package]] +name = "futures-util" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 5.3.0", + "wasip2", + "wasm-bindgen", +] + [[package]] name = "getrandom" version = "0.4.2" @@ -433,7 +571,7 @@ checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 6.0.0", "wasip2", "wasip3", ] @@ -456,7 +594,7 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -465,6 +603,17 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +[[package]] +name = "hashbrown" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] + [[package]] name = "heck" version = "0.5.0" @@ -574,13 +723,99 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a" dependencies = [ + "cfg-if", + "futures-util", "wasm-bindgen", ] +[[package]] +name = "jsonschema" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e37f27df77c7887edbc5f5a59ecd8e5ec4a669319266ec1b61068667a603183" +dependencies = [ + "ahash", + "bytecount", + "data-encoding", + "email_address", + "fancy-regex", + "fraction", + "getrandom 0.3.4", + "itoa", + "jsonschema-macros", + "jsonschema-regex", + "jsonschema-value", + "num-cmp", + "num-traits", + "percent-encoding", + "referencing", + "regex", + "serde", + "serde_json", + "strum", + "unicode-general-category", + "uuid-simd", +] + +[[package]] +name = "jsonschema-macros" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3467cc02f0e5de53d77834726a4744c61bdd239336ae49902ff0cbf1842d930" +dependencies = [ + "jsonschema-macros-core", + "proc-macro2", +] + +[[package]] +name = "jsonschema-macros-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75afa4b5e6986cc221f5339d7d6149360f0bf8e65bcb23617dc0f92900b576d2" +dependencies = [ + "fancy-regex", + "indexmap", + "jsonschema-regex", + "percent-encoding", + "proc-macro-crate", + "proc-macro2", + "quote", + "referencing", + "regex", + "serde_json", + "syn 2.0.118", +] + +[[package]] +name = "jsonschema-regex" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e41151614b6c927e21982be8bef5a26741ae5a0ae6a781eedee2aa930a980e6" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "jsonschema-value" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515b9a91134ef67d7bac95c2d76fbc7e383c4c55ee544204ceec8088f881fef" +dependencies = [ + "ahash", + "bytecount", + "fraction", + "getrandom 0.3.4", + "memchr", + "num-cmp", + "num-traits", + "serde_json", + "zmij", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -611,6 +846,15 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.4.35" @@ -623,6 +867,12 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +[[package]] +name = "micromap" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a86d3146ed3995b5913c414f6664344b9617457320782e64f0bb44afd49d74" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -641,11 +891,80 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -671,18 +990,53 @@ version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +[[package]] +name = "outref" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" + [[package]] name = "owo-colors" version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -751,6 +1105,15 @@ dependencies = [ "syn 3.0.10", ] +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit 0.25.1+spec-1.1.0", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -769,12 +1132,64 @@ 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 = "r-efi" version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.10", +] + +[[package]] +name = "referencing" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a028057ef852c58a42d75e09da87b5e733f4030f4c7411728955e4f87203a577" +dependencies = [ + "ahash", + "fluent-uri", + "getrandom 0.3.4", + "hashbrown 0.17.2", + "itoa", + "micromap", + "parking_lot", + "percent-encoding", + "serde_json", +] + [[package]] name = "regex" version = "1.12.4" @@ -789,9 +1204,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.14" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" dependencies = [ "aho-corasick", "memchr", @@ -800,9 +1215,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" [[package]] name = "regress" @@ -858,6 +1273,12 @@ dependencies = [ "windows-sys 0.61.1", ] +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + [[package]] name = "same-file" version = "1.0.6" @@ -916,6 +1337,12 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "semver" version = "1.0.28" @@ -1030,6 +1457,12 @@ dependencies = [ "bstr", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "smallvec" version = "1.16.2" @@ -1098,7 +1531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom", + "getrandom 0.4.2", "once_cell", "rustix 1.1.4", "windows-sys 0.61.1", @@ -1178,7 +1611,7 @@ dependencies = [ "serde", "serde_spanned 0.6.4", "toml_datetime 0.6.5", - "toml_edit", + "toml_edit 0.21.0", ] [[package]] @@ -1193,7 +1626,7 @@ dependencies = [ "toml_datetime 1.0.0+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 0.7.14", + "winnow 0.7.13", ] [[package]] @@ -1227,13 +1660,25 @@ dependencies = [ "winnow 0.5.28", ] +[[package]] +name = "toml_edit" +version = "0.25.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "538ed8bc4ada0b2549f2a7be9654aac2dfa358faeabb97d7845c3eb5a297e5d6" +dependencies = [ + "indexmap", + "toml_datetime 1.0.0+spec-1.1.0", + "toml_parser", + "winnow 0.7.13", +] + [[package]] name = "toml_parser" version = "1.0.8+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0742ff5ff03ea7e67c8ae6c93cac239e0d9784833362da3f9a9c1da8dfefcbdc" dependencies = [ - "winnow 0.7.14", + "winnow 0.7.13", ] [[package]] @@ -1313,15 +1758,17 @@ dependencies = [ [[package]] name = "typespace" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f85ea45c92b262c35a6e8e563e27951b86275e8c3e3aa03ba4cf9addeaf5ef7" +checksum = "1514ee4a121cdb4190bacd30981e032a4b861299c1abefd547a52f757e253d46" dependencies = [ "codespace", "heck", + "jsonschema", "log", "proc-macro2", "quote", + "regress", "schemars", "serde", "serde_json", @@ -1404,6 +1851,12 @@ dependencies = [ "typify", ] +[[package]] +name = "unicode-general-category" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b993bddc193ae5bd0d623b49ec06ac3e9312875fdae725a975c51db1cc1677f" + [[package]] name = "unicode-ident" version = "1.0.27" @@ -1443,6 +1896,16 @@ dependencies = [ "serde", ] +[[package]] +name = "uuid-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b082222b4f6619906941c17eb2297fff4c2fb96cb60164170522942a200bd8" +dependencies = [ + "outref", + "vsimd", +] + [[package]] name = "valuable" version = "0.1.1" @@ -1459,6 +1922,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "wait-timeout" version = "0.2.1" @@ -1498,34 +1973,21 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c" dependencies = [ "cfg-if", + "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.118", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1533,22 +1995,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.118", - "wasm-bindgen-backend", + "syn 3.0.10", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-encoder" @@ -1782,9 +2247,12 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.14" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +dependencies = [ + "memchr", +] [[package]] name = "wit-bindgen" @@ -1880,8 +2348,28 @@ dependencies = [ "wasmparser", ] +[[package]] +name = "zerocopy" +version = "0.8.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed43f3060383c64b000f3c630550aebdfa9d3b76d48de32390483dd2cc7e0865" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5cbd820fe3e35fb38c83b6dc7e6b1618bc46e0cd10073ae94e8d52dc468d8b9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.118", +] + [[package]] name = "zmij" -version = "1.0.2" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4a4e8e9dc5c62d159f04fcdbe07f4c3fb710415aab4754bf11505501e3251d" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index 109dee48..b9eb4844 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ resolver = "2" [workspace.package] -rust-version = "1.97" +rust-version = "1.88" [workspace.dependencies] typify = { version = "0.10.1", path = "typify" } @@ -46,6 +46,6 @@ syn = { version = "3.0.2", features = ["full"] } tempfile = "3.27.0" thiserror = "2.0.18" trybuild = "1.0.116" -typespace = "0.1.3" +typespace = "0.1.4" unicode-ident = "1.0.24" uuid = "1.16.0" From 2bb03854313b59554b76d1289ed11c08bff48881 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Mon, 23 Nov 2026 09:53:11 -0500 Subject: [PATCH 2/3] stop wrapping an optional flattened member in Option; typespace does it --- CHANGELOG.adoc | 2 ++ typify-impl/src/structs.rs | 5 +---- typify-impl/tests/vega.out | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index cf2f8054..5c496010 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -21,6 +21,8 @@ https://github.com/oxidecomputer/typify/compare/v0.10.1\...HEAD[Full list of com (typespace #74). * A default on a constrained newtype that the generated `TryFrom` would refuse now fails generation instead of being baked into the output (typespace #77). +* An optional flattened property is a plain `#[serde(flatten)] Option` + without a `skip_serializing_if`, which serde ignores on a flattened field. == 0.10.1 (released 2026-11-16) diff --git a/typify-impl/src/structs.rs b/typify-impl/src/structs.rs index 1713cae9..89196658 100644 --- a/typify-impl/src/structs.rs +++ b/typify-impl/src/structs.rs @@ -260,10 +260,7 @@ impl TypeSpace { None => Name::Unknown, }; - let (mut type_id, _) = self.id_for_schema(type_name, schema)?; - if optional { - type_id = self.id_to_option(&type_id); - } + let (type_id, _) = self.id_for_schema(type_name, schema)?; // TODO we need a reasonable name that could be derived // from the name of the type diff --git a/typify-impl/tests/vega.out b/typify-impl/tests/vega.out index f1fb9efd..dc161ad1 100644 --- a/typify-impl/tests/vega.out +++ b/typify-impl/tests/vega.out @@ -6905,15 +6905,15 @@ impl ::std::convert::From<::std::vec::Vec<::std::string::String>> for DataVarian #[serde(untagged)] pub enum DataVariant2Format { Variant0 { - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_0: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_1: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_2: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_3: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_4: ::std::option::Option, }, Variant1(SignalRef), @@ -8383,15 +8383,15 @@ impl ::std::convert::TryFrom<::std::string::String> #[serde(untagged)] pub enum DataVariant3Format { Variant0 { - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_0: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_1: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_2: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_3: ::std::option::Option, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] subtype_4: ::std::option::Option, }, Variant1(SignalRef), @@ -42549,11 +42549,11 @@ impl ::std::convert::From for TitleObjectDy { #[doc = "`TitleObjectEncode`"] #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug, Default)] pub struct TitleObjectEncode { - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] pub subtype_0: ::std::option::Option< ::std::collections::HashMap, >, - #[serde(flatten, skip_serializing_if = "::std::option::Option::is_none")] + #[serde(flatten)] pub subtype_1: ::std::option::Option, } #[doc = "`TitleObjectEncodeSubtype0Key`"] From 5d99fe0fbdd4eb11e4988d978d913f51b1ff4e27 Mon Sep 17 00:00:00 2001 From: "Adam H. Leventhal" Date: Mon, 23 Nov 2026 10:49:47 -0500 Subject: [PATCH 3/3] update changelog --- CHANGELOG.adoc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 5c496010..fef739a0 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -16,13 +16,9 @@ https://github.com/oxidecomputer/typify/compare/v0.10.1\...HEAD[Full list of commits] * Handle the `const` keyword (#1115) -* Lower the MSRV to 1.88, matching typespace 0.1.4. -* A newtype with a schema `default` gets its `Default` impl back, as in 0.8 +* Lower the MSRV to 1.88 +* A newtype with a schema `default` gets its `Default` impl back, per 0.8 (typespace #74). -* A default on a constrained newtype that the generated `TryFrom` would refuse - now fails generation instead of being baked into the output (typespace #77). -* An optional flattened property is a plain `#[serde(flatten)] Option` - without a `skip_serializing_if`, which serde ignores on a flattened field. == 0.10.1 (released 2026-11-16)