diff --git a/Cargo.lock b/Cargo.lock index 92e6a22b4b916..36637b865ae0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,17 +68,17 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "ammonia" -version = "4.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" +checksum = "64e6d1c7838db705c9b756557ee27c384ce695a1c51a6fe528784cb1c6840170" dependencies = [ - "html5ever 0.27.0", + "html5ever", "maplit", "once_cell", "tendril", @@ -141,57 +141,56 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-lossy" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcff6599f06e21b0165c85052ccd6e67dc388ddd1c516a9dc5f55dc8cacf004" +checksum = "a9a0444767dbd4aea9355cb47a370eb184dbfe918875e127eff52cb9d1638181" dependencies = [ "anstyle", ] [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-svg" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbf0bf947d663010f0b4132f28ca08da9151f3b9035fa7578a38de521c1d1aa" +checksum = "8b6ddad447b448d6d5db36b31cbd3ff27c7af071619501998eeceab01968287a" dependencies = [ "anstream", "anstyle", @@ -202,9 +201,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -212,9 +211,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" dependencies = [ "backtrace", ] @@ -257,7 +256,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -277,9 +276,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" @@ -390,15 +389,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bytecount" -version = "0.6.8" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" +checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +dependencies = [ + "packed_simd", +] [[package]] name = "byteorder" @@ -414,9 +416,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "camino" -version = "1.1.7" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] @@ -477,9 +479,9 @@ version = "0.1.0" [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -507,7 +509,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -571,15 +573,15 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", "terminal_size", ] [[package]] name = "clap_complete" -version = "4.5.2" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" +checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c" dependencies = [ "clap", ] @@ -593,7 +595,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -620,7 +622,7 @@ dependencies = [ "regex", "rustc_tools_util", "serde", - "syn 2.0.64", + "syn 2.0.58", "tempfile", "termize", "tokio", @@ -647,7 +649,7 @@ dependencies = [ "clap", "indoc", "itertools 0.12.1", - "opener 0.6.1", + "opener", "shell-escape", "walkdir", ] @@ -714,23 +716,23 @@ dependencies = [ [[package]] name = "color-print" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee543c60ff3888934877a5671f45494dd27ed4ba25c6670b9a7576b7ed7a8c0" +checksum = "7a858372ff14bab9b1b30ea504f2a4bc534582aee3e42ba2d41d2a7baba63d5d" dependencies = [ "color-print-proc-macro", ] [[package]] name = "color-print-proc-macro" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ff1a80c5f3cb1ca7c06ffdd71b6a6dd6d8f896c42141fbd43f50ed28dcdb93" +checksum = "57e37866456a721d0a404439a1adae37a31be4e0055590d053dfe6981e05003f" dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.64", + "syn 1.0.109", ] [[package]] @@ -747,9 +749,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" @@ -947,9 +949,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -957,27 +959,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.64", + "strsim 0.10.0", + "syn 2.0.58", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -986,24 +988,13 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69" -[[package]] -name = "dbus" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" -dependencies = [ - "libc", - "libdbus-sys", - "winapi", -] - [[package]] name = "declare_clippy_lint" version = "0.1.80" dependencies = [ "itertools 0.12.1", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1044,7 +1035,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1054,7 +1045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1077,7 +1068,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1166,14 +1157,14 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] name = "dissimilar" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" +checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" [[package]] name = "dlmalloc" @@ -1190,9 +1181,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elasticlunr-rs" @@ -1261,9 +1252,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1304,9 +1295,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "field-offset" @@ -1326,15 +1317,15 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "windows-sys 0.52.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1342,9 +1333,9 @@ dependencies = [ [[package]] name = "fluent-bundle" -version = "0.15.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe0a21ee80050c678013f82edf4b705fe2f26f1f9877593d13198612503f493" +checksum = "e242c601dec9711505f6d5bbff5bedd4b61b2469f2e8bb8e57ee7c9747a87ffd" dependencies = [ "fluent-langneg", "fluent-syntax", @@ -1367,9 +1358,9 @@ dependencies = [ [[package]] name = "fluent-syntax" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a530c4694a6a8d528794ee9bbd8ba0122e779629ac908d15ad5a7ae7763a33d" +checksum = "c0abed97648395c902868fee9026de96483933faa54ea3b40d652f7dfe61ca78" dependencies = [ "thiserror", ] @@ -1480,7 +1471,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1552,9 +1543,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "a06fddc2749e0528d2813f95e050e87e52c8cbbae56223b9babf73b3e53b0cc6" dependencies = [ "cfg-if", "libc", @@ -1619,9 +1610,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -1693,24 +1684,20 @@ checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" dependencies = [ "log", "mac", - "markup5ever 0.11.0", + "markup5ever", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] -name = "html5ever" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" +name = "htmldocck" +version = "0.1.0" dependencies = [ - "log", - "mac", - "markup5ever 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.64", + "getopts", + "regex", + "shlex", + "unicode-width", ] [[package]] @@ -1842,7 +1829,7 @@ checksum = "d2abdd3a62551e8337af119c5899e600ca0c88ec8f23a46c60ba216c803dcf1a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -1945,18 +1932,18 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] [[package]] name = "intl-memoizer" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe22e020fce238ae18a6d5d8c502ee76a52a6e880d99477657e6acc30ec57bda" +checksum = "c310433e4a310918d6ed9243542a6b83ec1183df95dff8f23f87bb88a264a66f" dependencies = [ "type-map", "unic-langid", @@ -1971,12 +1958,6 @@ dependencies = [ "unic-langid", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" - [[package]] name = "itertools" version = "0.11.0" @@ -2013,9 +1994,9 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] @@ -2085,23 +2066,13 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" dependencies = [ "rustc-std-workspace-core", ] -[[package]] -name = "libdbus-sys" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "libffi" version = "3.2.0" @@ -2128,7 +2099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -2163,7 +2134,7 @@ dependencies = [ name = "linkchecker" version = "0.1.0" dependencies = [ - "html5ever 0.26.0", + "html5ever", "regex", ] @@ -2178,9 +2149,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "litemap" @@ -2205,9 +2176,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -2256,20 +2227,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "markup5ever" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" -dependencies = [ - "log", - "phf 0.11.2", - "phf_codegen 0.11.2", - "string_cache", - "string_cache_codegen", - "tendril", -] - [[package]] name = "matchers" version = "0.1.0" @@ -2291,9 +2248,9 @@ dependencies = [ [[package]] name = "mdbook" -version = "0.4.40" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45a38e19bd200220ef07c892b0157ad3d2365e5b5a267ca01ad12182491eea5" +checksum = "0c33564061c3c640bed5ace7d6a2a1b65f2c64257d1ac930c15e94ed0fb561d3" dependencies = [ "ammonia", "anyhow", @@ -2306,8 +2263,8 @@ dependencies = [ "log", "memchr", "once_cell", - "opener 0.7.1", - "pulldown-cmark 0.10.3", + "opener", + "pulldown-cmark 0.10.2", "regex", "serde", "serde_json", @@ -2389,9 +2346,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", "compiler_builtins", @@ -2509,11 +2466,12 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2587,18 +2545,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "opener" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0" -dependencies = [ - "bstr", - "dbus", - "normpath", - "windows-sys 0.52.0", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -2659,6 +2605,16 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "packed_simd" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d" +dependencies = [ + "cfg-if", + "num-traits", +] + [[package]] name = "pad" version = "0.1.6" @@ -2704,9 +2660,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -2714,15 +2670,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] @@ -2757,9 +2713,9 @@ dependencies = [ [[package]] name = "pest" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -2768,9 +2724,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -2778,22 +2734,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -2947,9 +2903,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -2993,9 +2949,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.10.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" +checksum = "5f0530d13d87d1f549b66a3e8d0c688952abe5994e204ed62615baaf25dc029c" dependencies = [ "bitflags 2.5.0", "memchr", @@ -3005,9 +2961,9 @@ dependencies = [ [[package]] name = "pulldown-cmark-escape" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" +checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b" [[package]] name = "punycode" @@ -3023,9 +2979,9 @@ checksum = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -3128,15 +3084,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - [[package]] name = "redox_users" version = "0.4.5" @@ -3272,9 +3219,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", @@ -3835,7 +3782,7 @@ dependencies = [ "fluent-syntax", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "unic-langid", ] @@ -3969,7 +3916,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "synstructure", ] @@ -4116,7 +4063,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "synstructure", ] @@ -4694,7 +4641,7 @@ version = "0.0.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "synstructure", ] @@ -4792,7 +4739,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -4827,9 +4774,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ "bitflags 2.5.0", "errno", @@ -4840,9 +4787,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ruzstd" @@ -4868,9 +4815,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -4908,49 +4855,49 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14e4d63b804dc0c7ec4a1e52bcb63f02c7ac94476755aa579edac21e01f915d" dependencies = [ - "self_cell 1.0.4", + "self_cell 1.0.3", ] [[package]] name = "self_cell" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" +checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" [[package]] name = "semver" -version = "1.0.23" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.202" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "indexmap", "itoa", @@ -4960,9 +4907,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -5045,9 +4992,9 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", "windows-sys 0.52.0", @@ -5191,6 +5138,12 @@ dependencies = [ "quote", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -5237,9 +5190,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.64" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -5254,14 +5207,14 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] name = "sysinfo" -version = "0.30.12" +version = "0.30.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732ffa00f53e6b2af46208fba5718d9662a421049204e156328b66791ffa15ae" +checksum = "4b1a378e48fb3ce3a5cf04359c456c9c98ff689bcf1c1bc6e6a31f247686f275" dependencies = [ "cfg-if", "core-foundation-sys", @@ -5384,22 +5337,22 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -5541,9 +5494,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -5587,7 +5540,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -5665,9 +5618,9 @@ dependencies = [ [[package]] name = "type-map" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb68604048ff8fa93347f02441e4487594adc20bb8a084f9e564d2b827a0a9f" +checksum = "b6d3364c5e96cb2ad1603037ab253ddd34d7fb72a58bdddf4b7350760fc69a46" dependencies = [ "rustc-hash", ] @@ -5750,9 +5703,9 @@ dependencies = [ [[package]] name = "unic-langid" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" +checksum = "238722e6d794ed130f91f4ea33e01fcff4f188d92337a21297892521c72df516" dependencies = [ "unic-langid-impl", "unic-langid-macros", @@ -5760,18 +5713,18 @@ dependencies = [ [[package]] name = "unic-langid-impl" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" +checksum = "4bd55a2063fdea4ef1f8633243a7b0524cbeef1905ae04c31a1c9b9775c55bc6" dependencies = [ "tinystr", ] [[package]] name = "unic-langid-macros" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da1cd2c042d3c7569a1008806b02039e7a4a2bdf8f8e96bd3c792434a0e275e" +checksum = "5c854cefb82ff2816410ce606acbad1b3af065140907b29be9229040752b83ec" dependencies = [ "proc-macro-hack", "tinystr", @@ -5781,13 +5734,13 @@ dependencies = [ [[package]] name = "unic-langid-macros-impl" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed7f4237ba393424195053097c1516bd4590dc82b84f2f97c5c69e12704555b" +checksum = "fea2a4c80deb4fb3ca51f66b5e2dd91e3642bbce52234bcf22e41668281208e4" dependencies = [ "proc-macro-hack", "quote", - "syn 2.0.64", + "syn 2.0.58", "unic-langid-impl", ] @@ -5858,9 +5811,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" dependencies = [ "compiler_builtins", "rustc-std-workspace-core", @@ -6010,7 +5963,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -6032,7 +5985,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6080,11 +6033,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "windows-sys 0.52.0", + "winapi", ] [[package]] @@ -6100,7 +6053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -6113,7 +6066,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "syn 2.0.64", + "syn 2.0.58", "windows-metadata", ] @@ -6123,7 +6076,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -6147,7 +6100,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.4", ] [[package]] @@ -6167,18 +6120,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -6189,9 +6141,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -6201,9 +6153,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -6213,15 +6165,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -6231,9 +6177,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -6243,9 +6189,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -6255,9 +6201,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -6267,9 +6213,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" @@ -6335,28 +6281,28 @@ checksum = "9e6936f0cce458098a201c245a11bef556c6a0181129c7034d10d76d1ec3a2b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] [[package]] @@ -6376,7 +6322,7 @@ checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", "synstructure", ] @@ -6399,5 +6345,5 @@ checksum = "7b4e5997cbf58990550ef1f0e5124a05e47e1ebd33a84af25739be6031a62c20" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.58", ] diff --git a/Cargo.toml b/Cargo.toml index a601ebf4369e0..7b0d2a3f85bac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ members = [ "src/tools/miri/cargo-miri", "src/tools/rustdoc-themes", "src/tools/unicode-table-generator", + "src/tools/htmldocck", "src/tools/jsondocck", "src/tools/jsondoclint", "src/tools/llvm-bitcode-linker", diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs index 01b5e99116ff2..136cb58365e1f 100644 --- a/src/bootstrap/src/core/build_steps/clippy.rs +++ b/src/bootstrap/src/core/build_steps/clippy.rs @@ -311,7 +311,8 @@ lint_any!( CollectLicenseMetadata, "src/tools/collect-license-metadata", "collect-license-metadata"; Compiletest, "src/tools/compiletest", "compiletest"; CoverageDump, "src/tools/coverage-dump", "coverage-dump"; - Jsondocck, "src/tools/jsondocck", "jsondocck"; + HtmldocCk, "src/tools/htmldocck", "htmldocck"; + JsondocCk, "src/tools/jsondocck", "jsondocck"; Jsondoclint, "src/tools/jsondoclint", "jsondoclint"; LintDocs, "src/tools/lint-docs", "lint-docs"; LlvmBitcodeLinker, "src/tools/llvm-bitcode-linker", "llvm-bitcode-linker"; diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 360bd3840d456..0127337a3df92 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1766,13 +1766,18 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler)); } + if mode == "rustdoc" { + // Use the beta compiler for htmldocck. + let compiler = compiler.with_stage(0); + cmd.arg("--htmldocck-path").arg(builder.ensure(tool::HtmlDocCk { compiler, target })); + } + if mode == "rustdoc-json" { - // Use the beta compiler for jsondocck - let json_compiler = compiler.with_stage(0); - cmd.arg("--jsondocck-path") - .arg(builder.ensure(tool::JsonDocCk { compiler: json_compiler, target })); + // Use the beta compiler for jsondocck. + let compiler = compiler.with_stage(0); + cmd.arg("--jsondocck-path").arg(builder.ensure(tool::JsonDocCk { compiler, target })); cmd.arg("--jsondoclint-path") - .arg(builder.ensure(tool::JsonDocLint { compiler: json_compiler, target })); + .arg(builder.ensure(tool::JsonDocLint { compiler, target })); } if mode == "coverage-map" { diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 2db3f8f79364e..c394f9a0a8157 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -303,6 +303,7 @@ bootstrap_tool!( RustInstaller, "src/tools/rust-installer", "rust-installer"; RustdocTheme, "src/tools/rustdoc-themes", "rustdoc-themes"; LintDocs, "src/tools/lint-docs", "lint-docs"; + HtmlDocCk, "src/tools/htmldocck", "htmldocck"; JsonDocCk, "src/tools/jsondocck", "jsondocck"; JsonDocLint, "src/tools/jsondoclint", "jsondoclint"; HtmlChecker, "src/tools/html-checker", "html-checker"; diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs index 045cde56f4119..73a21c1f23e1e 100644 --- a/src/bootstrap/src/core/builder.rs +++ b/src/bootstrap/src/core/builder.rs @@ -764,7 +764,8 @@ impl<'a> Builder<'a> { clippy::CollectLicenseMetadata, clippy::Compiletest, clippy::CoverageDump, - clippy::Jsondocck, + clippy::HtmldocCk, + clippy::JsondocCk, clippy::Jsondoclint, clippy::LintDocs, clippy::LlvmBitcodeLinker, diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 7ff45edd4b26b..c012146f2660e 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -193,9 +193,12 @@ pub struct Config { /// The coverage-dump executable. pub coverage_dump_path: Option, - /// The Python executable to use for LLDB and htmldocck. + /// The Python executable to use for LLDB. pub python: String, + /// The htmldocck executable. + pub htmldocck_path: Option, + /// The jsondocck executable. pub jsondocck_path: Option, diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 8a37a4d6d3135..01a644827888d 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -131,6 +131,7 @@ impl ConfigBuilder { "--compile-lib-path=", "--run-lib-path=", "--python=", + // FIXME(fmease): Do we need to set htmldocck-path to "", too? "--jsondocck-path=", "--src-base=", "--build-base=", diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 99bde107f3a47..e7f0ad2f0297a 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -48,7 +48,9 @@ pub fn parse_config(args: Vec) -> Config { .optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH") .optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH") .optopt("", "coverage-dump-path", "path to coverage-dump to use in tests", "PATH") + // FIXME(fmease): fix docs here .reqopt("", "python", "path to python to use for doc tests", "PATH") + .optopt("", "htmldocck-path", "path to htmldocck to use for doc tests", "PATH") .optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH") .optopt("", "jsondoclint-path", "path to jsondoclint to use for doc tests", "PATH") .optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM") @@ -235,6 +237,7 @@ pub fn parse_config(args: Vec) -> Config { rust_demangler_path: matches.opt_str("rust-demangler-path").map(PathBuf::from), coverage_dump_path: matches.opt_str("coverage-dump-path").map(PathBuf::from), python: matches.opt_str("python").unwrap(), + htmldocck_path: matches.opt_str("htmldocck-path"), jsondocck_path: matches.opt_str("jsondocck-path"), jsondoclint_path: matches.opt_str("jsondoclint-path"), valgrind_path: matches.opt_str("valgrind-path"), @@ -617,6 +620,7 @@ fn common_inputs_stamp(config: &Config) -> Stamp { if let Some(ref rustdoc_path) = config.rustdoc_path { stamp.add_path(&rustdoc_path); + // FIXME(fmease): Remove this one once the rewrite is completed. stamp.add_path(&rust_src_dir.join("src/etc/htmldocck.py")); } diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 02c9d384ab7e4..ce6fa2e9f9051 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3030,9 +3030,16 @@ impl<'test> TestCx<'test> { if self.props.check_test_line_numbers_match { self.check_rustdoc_test_option(proc_res); } else { - let root = self.config.find_rust_src_root().unwrap(); - let mut cmd = Command::new(&self.config.python); - cmd.arg(root.join("src/etc/htmldocck.py")).arg(&out_dir).arg(&self.testpaths.file); + // FIXME(fmease): Temporary commented out code: + // FIXME(fmease): I don't like this unwrap! + let mut cmd = Command::new(self.config.htmldocck_path.as_ref().unwrap()); + cmd.arg("--doc-dir").arg(&out_dir).arg("--template").arg(&self.testpaths.file); + + // let root = self.config.find_rust_src_root().unwrap(); + // let mut cmd = Command::new(&self.config.python); + // cmd.arg(root.join("src/etc/htmldocck.py")); + // cmd.arg(&out_dir).arg(&self.testpaths.file); + if self.config.bless { cmd.arg("--bless"); } diff --git a/src/tools/htmldocck/Cargo.toml b/src/tools/htmldocck/Cargo.toml new file mode 100644 index 0000000000000..4ff8f9c090503 --- /dev/null +++ b/src/tools/htmldocck/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "htmldocck" +version = "0.1.0" +description = "A test framework for rustdoc's HTML backend" +edition = "2021" + +[dependencies] +getopts = "0.2" +regex = "1.8" # 1.8 to avoid memchr 2.6.0, as 2.5.0 is pinned in the workspace +shlex = "1.3.0" +unicode-width = "0.1.4" diff --git a/src/tools/htmldocck/src/cache.rs b/src/tools/htmldocck/src/cache.rs new file mode 100644 index 0000000000000..cebe266b02582 --- /dev/null +++ b/src/tools/htmldocck/src/cache.rs @@ -0,0 +1,69 @@ +use std::{ + collections::{hash_map::Entry, HashMap}, + path::Path, +}; + +use crate::error::DiagCtxt; + +pub(crate) struct Cache<'a> { + root: &'a Path, + // FIXME: `&'a str`s + files: HashMap, + // FIXME: `&'a str`, comment what this is for -- `-` + last_path: Option, +} + +impl<'a> Cache<'a> { + pub(crate) fn new(root: &'a Path) -> Self { + Self { root, files: HashMap::new(), last_path: None } + } + + // FIXME: check file vs. dir (`@has ` vs. `@has-dir `) + /// Check if the path points to an existing entity. + pub(crate) fn has(&mut self, path: String, dcx: &mut DiagCtxt) -> Result { + // FIXME: should we use `try_exists` over `exists` instead? matters the most for `@!has `. + let path = self.resolve(path, dcx)?; + + Ok(self.files.contains_key(&path) || Path::new(&path).exists()) + } + + /// Load the contents of the given path. + pub(crate) fn load(&mut self, path: String, dcx: &mut DiagCtxt) -> Result<&str, ()> { + let path = self.resolve(path, dcx)?; + + Ok(match self.files.entry(path) { + Entry::Occupied(entry) => entry.into_mut(), + Entry::Vacant(entry) => { + // FIXME: better message, location + let data = + std::fs::read_to_string(self.root.join(entry.key())).map_err(|error| { + dcx.emit(&format!("failed to read file: {error}"), None, None) + })?; + entry.insert(data) + } + }) + } + + // FIXME: &str -> &str if possible + fn resolve(&mut self, path: String, dcx: &mut DiagCtxt) -> Result { + if path == "-" { + // FIXME: no cloning + return self + .last_path + .clone() + // FIXME better diag, location + .ok_or_else(|| { + dcx.emit( + "attempt to use `-` ('previous path') in the very first command", + None, + None, + ) + }); + } + + // While we could normalize the `path` at this point by + // using `std::path::absolute`, it's likely not worth it. + self.last_path = Some(path.clone()); + Ok(path) + } +} diff --git a/src/tools/htmldocck/src/channel.rs b/src/tools/htmldocck/src/channel.rs new file mode 100644 index 0000000000000..cb7ac188c7902 --- /dev/null +++ b/src/tools/htmldocck/src/channel.rs @@ -0,0 +1,50 @@ +// FIXME: document that the "channel" is indeed a channel *URL*! + +use std::{borrow::Cow, sync::OnceLock}; + +use crate::error::DiagCtxt; + +const PLACEHOLDER: &str = "{{channel}}"; +const ENV_VAR_KEY: &str = "DOC_RUST_LANG_ORG_CHANNEL"; + +pub(crate) fn instantiate<'a>(input: &'a str, dcx: &mut DiagCtxt) -> Result, ()> { + let Some(channel) = channel(dcx)? else { return Ok(input.into()) }; + Ok(input.replace(PLACEHOLDER, channel).into()) +} + +#[allow(dead_code)] // FIXME +pub(crate) fn anonymize<'a>(input: &'a str, dcx: &'_ mut DiagCtxt) -> Result, ()> { + let Some(channel) = channel(dcx)? else { return Ok(input.into()) }; + Ok(input.replace(channel, PLACEHOLDER).into()) +} + +fn channel(dcx: &mut DiagCtxt) -> Result, ()> { + static CHANNEL_URL: OnceLock> = OnceLock::new(); + + // FIXME: Use `get_or_try_init` here (instead of `get`→`set`→`get`) if/once stabilized (on beta). + + if let Some(channel_url) = CHANNEL_URL.get() { + return Ok(channel_url.as_deref()); + } + + let channel_url = match std::env::var(ENV_VAR_KEY) { + Ok(url) => Some(url), + // FIXME: should we make the channel mandatory instead? + Err(std::env::VarError::NotPresent) => None, + Err(std::env::VarError::NotUnicode(var)) => { + // FIXME: better diag + // FIXME: Use `OsStr::display` (instead of `to_string_lossy`) if/once stabilized (on beta). + dcx.emit( + &format!("env var `{ENV_VAR_KEY}` is not valid UTF-8: `{}`", var.to_string_lossy()), + None, + None, + ); + return Err(()); + } + }; + + // unwrap: The static item is locally scoped and no other thread tries to initialize it. + CHANNEL_URL.set(channel_url).unwrap(); + // unwrap: Initialized above. + Ok(CHANNEL_URL.get().unwrap().as_deref()) +} diff --git a/src/tools/htmldocck/src/check.rs b/src/tools/htmldocck/src/check.rs new file mode 100644 index 0000000000000..a541c16902248 --- /dev/null +++ b/src/tools/htmldocck/src/check.rs @@ -0,0 +1,79 @@ +use crate::cache::Cache; +use crate::error::{DiagCtxt, Source}; +use crate::{channel, Command, CommandKind}; + +impl Command<'_> { + pub(crate) fn check(self, cache: &mut Cache<'_>, dcx: &mut DiagCtxt) -> Result<(), ()> { + let result = self.kind.check(cache, self.source.clone(), dcx)?; + + if result == self.negated { + // FIXME: better diag + dcx.emit("check failed", self.source, None); + return Err(()); + } + + Ok(()) + } +} + +impl CommandKind { + // FIXME: implement all checks! + fn check( + self, + cache: &mut Cache<'_>, + _source: Source<'_>, // FIXME: unused + dcx: &mut DiagCtxt, + ) -> Result { + Ok(match self { + Self::HasFile { path } => cache.has(path, dcx)?, // FIXME: check if it's actually a file + Self::HasDir { path } => cache.has(path, dcx)?, // FIXME: check if it's actually a directory + Self::Has { path, xpath, text } => { + let _data = cache.load(path, dcx)?; + _ = xpath; + _ = text; + true // FIXME + } + Self::HasRaw { path, text } => { + let data = cache.load(path, dcx)?; + + if text.is_empty() { + // fast path + return Ok(true); + } + + let text = channel::instantiate(&text, dcx)?; + let text = text.replace(|c: char| c.is_ascii_whitespace(), " "); + let data = data.replace(|c: char| c.is_ascii_whitespace(), " "); + + data.contains(&text) + } + Self::Matches { path, xpath, pattern } => { + let _data = cache.load(path, dcx)?; + _ = xpath; + _ = pattern; + + true // FIXME + } + Self::MatchesRaw { path, pattern } => pattern.is_match(cache.load(path, dcx)?), + Self::Count { path, xpath, text, count } => { + let _data = cache.load(path, dcx)?; + _ = xpath; + _ = text; + _ = count; + true // FIXME + } + Self::Files { path, files } => { + let _data = cache.load(path, dcx)?; + _ = files; + true // FIXME + } + Self::Snapshot { name, path, xpath } => { + let _data = cache.load(path, dcx)?; + _ = name; + _ = path; + _ = xpath; + true // FIXME + } + }) + } +} diff --git a/src/tools/htmldocck/src/config.rs b/src/tools/htmldocck/src/config.rs new file mode 100644 index 0000000000000..234050fcd953a --- /dev/null +++ b/src/tools/htmldocck/src/config.rs @@ -0,0 +1,47 @@ +use std::path::PathBuf; + +use crate::error::DiagCtxt; + +pub(crate) struct Config { + /// The path to the directory that contains the generated HTML documentation. + pub(crate) doc_dir: PathBuf, + /// The path to the test file the docs were generated for and which may contain check commands. + pub(crate) template: String, + /// Whether to automatically update snapshot files. + #[allow(dead_code)] // FIXME + pub(crate) bless: bool, +} + +impl Config { + pub(crate) fn parse(args: &[String], dcx: &mut DiagCtxt) -> Result { + const DOC_DIR_OPT: &str = "doc-dir"; + const TEMPLATE_OPT: &str = "template"; + const BLESS_FLAG: &str = "bless"; + + let mut opts = getopts::Options::new(); + opts.reqopt("", DOC_DIR_OPT, "Path to the documentation directory", "") + .reqopt("", TEMPLATE_OPT, "Path to the template file", "") + .optflag("", BLESS_FLAG, "Whether to automatically update snapshot files"); + + // We may not assume the presence of the first argument. On some platforms, + // it's possible to pass an empty array of arguments to `execve`. + let program = args.get(0).map(|arg| arg.as_str()).unwrap_or("htmldocck"); + let args = args.get(1..).unwrap_or_default(); + + match opts.parse(args) { + Ok(matches) => Ok(Self { + doc_dir: matches.opt_str(DOC_DIR_OPT).unwrap().into(), + template: matches.opt_str(TEMPLATE_OPT).unwrap(), + bless: matches.opt_present(BLESS_FLAG), + }), + Err(err) => { + let mut err = err.to_string(); + err.push_str("\n\n"); + err.push_str(&opts.short_usage(program)); + err.push_str(&opts.usage("")); + dcx.emit(&err, None, None); + Err(()) + } + } + } +} diff --git a/src/tools/htmldocck/src/error.rs b/src/tools/htmldocck/src/error.rs new file mode 100644 index 0000000000000..f306b266391dc --- /dev/null +++ b/src/tools/htmldocck/src/error.rs @@ -0,0 +1,75 @@ +use std::ops::Range; + +use unicode_width::UnicodeWidthStr; + +pub(crate) struct DiagCtxt { + count: usize, +} + +impl DiagCtxt { + pub(crate) fn scope(run: impl FnOnce(&mut Self) -> Result<(), ()>) -> Result<(), ()> { + let mut dcx = Self::new(); + let result = run(&mut dcx); + dcx.summarize(); + match result { + Ok(()) if dcx.is_empty() => Ok(()), + _ => Err(()), + } + } + + fn new() -> Self { + Self { count: 0 } + } + + fn is_empty(&self) -> bool { + self.count == 0 + } + + // FIXME: Support for multiple subdiagnostics. + pub(crate) fn emit<'a>( + &mut self, + message: &str, + source: impl Into>>, + help: impl Into>, + ) { + self.count += 1; + self.print(message, source.into(), help.into()); + } + + fn print(&mut self, message: &str, source: Option>, help: Option<&str>) { + // FIXME: use proper coloring library + eprintln!("\x1b[31merror\x1b[0m: {message}"); + + let Some(source) = source else { return }; + + eprintln!("\x1b[1;36m{} | \x1b[0m{}", source.lineno, source.line); + + let underline_offset = source.line[..source.range.start].width(); + let underline_length = source.line[source.range].width(); + eprintln!( + "\x1b[1;36m{} \x1b[0m\x1b[31m{}{}{}\x1b[0m", + " ".repeat(source.lineno.ilog10() as usize + 1), + " ".repeat(underline_offset), + "^".repeat(underline_length), + // FIXME: get rid of format here + help.map(|help| format!(" help: {help}")).unwrap_or_default(), + ); + } + + fn summarize(&self) { + if self.is_empty() { + return; + } + + eprintln!(); + eprintln!("encountered {} error{}", self.count, if self.count == 1 { "" } else { "s" }); + } +} + +#[derive(Clone)] // FIXME: derive `Copy` once we can use `new_range`. +pub(crate) struct Source<'src> { + pub(crate) line: &'src str, + /// The one-based line number. + pub(crate) lineno: usize, + pub(crate) range: Range, +} diff --git a/src/tools/htmldocck/src/main.rs b/src/tools/htmldocck/src/main.rs new file mode 100644 index 0000000000000..1608d4cb8d894 --- /dev/null +++ b/src/tools/htmldocck/src/main.rs @@ -0,0 +1,80 @@ +//! HtmlDocCk is a test framework for rustdoc's HTML backend. +use std::process::ExitCode; + +use error::Source; +use regex::Regex; + +mod cache; +mod channel; +mod check; +mod config; +mod error; +mod parse; + +fn main() -> ExitCode { + let result = error::DiagCtxt::scope(|dcx| { + let args: Vec<_> = std::env::args().collect(); + let config = config::Config::parse(&args, dcx)?; + + // FIXME: better error message + let template = std::fs::read_to_string(&config.template) + .map_err(|error| dcx.emit(&format!("failed to read file: {error}"), None, None))?; + + let commands = parse::commands(&template, dcx); + + let mut cache = cache::Cache::new(&config.doc_dir); + commands.into_iter().try_for_each(|command| command.check(&mut cache, dcx)) + }); + + match result { + Ok(()) => ExitCode::SUCCESS, + Err(()) => ExitCode::FAILURE, + } +} + +/// A check command. +struct Command<'src> { + kind: CommandKind, + negated: bool, + source: Source<'src>, +} + +/// The kind of check command. +enum CommandKind { + /// `@has `. + HasFile { path: String }, + /// `@has-dir `. + HasDir { path: String }, + /// `@has `. + Has { path: String, xpath: String, text: String }, + /// `@hasraw `. + HasRaw { path: String, text: String }, + /// `@matches `. + Matches { path: String, xpath: String, pattern: Regex }, + /// `@matchesraw `. + MatchesRaw { path: String, pattern: Regex }, + /// `@count [] `. + Count { path: String, xpath: String, text: Option, count: u32 }, + /// `@files `. + Files { path: String, files: String }, + /// `@snapshot `. + Snapshot { name: String, path: String, xpath: String }, +} + +impl CommandKind { + /// Whether this kind of command may be negated with `!`. + fn may_be_negated(&self) -> bool { + // We match exhaustively to get a compile error if we add a new kind of command. + match self { + Self::Has { .. } + | Self::HasFile { .. } + | Self::HasDir { .. } + | Self::HasRaw { .. } + | Self::Matches { .. } + | Self::MatchesRaw { .. } + | Self::Count { .. } + | Self::Snapshot { .. } => true, + Self::Files { .. } => false, + } + } +} diff --git a/src/tools/htmldocck/src/parse.rs b/src/tools/htmldocck/src/parse.rs new file mode 100644 index 0000000000000..f458bb6c6ea6b --- /dev/null +++ b/src/tools/htmldocck/src/parse.rs @@ -0,0 +1,215 @@ +use std::sync::OnceLock; + +use regex::Regex; + +use crate::error::{DiagCtxt, Source}; +use crate::{channel, Command, CommandKind}; + +/// Parse all commands inside of the given template. +// FIXME: Add comment that this doesn't conflict with the ui_test-style compiletest directives +pub(crate) fn commands<'src>(template: &'src str, dcx: &mut DiagCtxt) -> Vec> { + // FIXME: Add comment that we do not respect Rust syntax for simplicity of implementation. + + // FIXME: port behavior of "concat_multi_lines(template)" + // FIXME: or `.split('\n')`? + template + .lines() + .enumerate() + .filter_map(|(index, line)| Command::parse(line, index + 1, dcx).ok()) + .collect() +} + +impl<'src> Command<'src> { + fn parse(line: &'src str, lineno: usize, dcx: &mut DiagCtxt) -> Result { + let captures = command_regex().captures(line).ok_or(())?; + + // FIXME: more accurate range + let source = Source { line, lineno, range: 0..line.len() }; + + let args = captures.name(group::ARGUMENTS).unwrap(); + let args = shlex::split(args.as_str()).ok_or_else(|| { + // Unfortunately, `shlex` doesn't provide us with the precise cause of failure. + // Nor does it provide the location of the erroneous string it encountered. + // Therefore we can't easily reconstruct this piece of information ourselves and + // we have no option but to emit a vague error for an imprecise location. + dcx.emit( + "command arguments are not properly terminated or escaped", + Source { line, lineno, range: args.range() }, + None, + ); + })?; + + let name = captures.name(group::NAME).unwrap(); + let kind = CommandKind::parse(name, &args, source.clone(), dcx)?; + + let negated = if let Some(negation) = captures.name(group::NEGATION) { + if !kind.may_be_negated() { + dcx.emit( + &format!("command `{}` may not be negated", name.as_str()), + Source { line, lineno, range: negation.range() }, + "remove the `!`", + ); + return Err(()); + } + true + } else { + false + }; + + if let Some(misplaced_negation) = captures.name(group::NEGATION_MISPLACED) { + // FIXME: better message + dcx.emit( + "misplaced negation `!`", + Source { line, lineno, range: misplaced_negation.range() }, + if negated && kind.may_be_negated() { + "move the `!` after the `@`" + } else { + // FIXME: more context + "remove the `!`" + }, + ); + return Err(()); + } + + Ok(Self { kind, negated, source }) + } +} + +impl CommandKind { + // FIXME: improve signature + fn parse( + name: regex::Match<'_>, + args: &[String], + source: Source<'_>, + dcx: &mut DiagCtxt, + ) -> Result { + // FIXME: heavily improve this diagnostic + let mut wrong_arity = |expected: &str| { + dcx.emit( + "incorrect number of arguments provided", + source.clone(), + format!("got {} but expected {expected}", args.len()).as_str(), + ); + }; + + // FIXME: avoid cloning by try_into'ing the args into arrays and moving the Strings + // or by draining the Vec & using Iterator::next + // FIXME: Add comment "unfortunately, `shlex` doesn't yield slices, only owned stuff" + // FIXME: parse `XPath`s here and provide beautiful errs with location info + match name.as_str() { + "has" => match args { + [path] => Ok(Self::HasFile { path: path.clone() }), + [path, xpath, text] => { + Ok(Self::Has { path: path.clone(), xpath: xpath.clone(), text: text.clone() }) + } + _ => Err(wrong_arity("1 or 3")), + }, + "hasraw" => match args { + [path, text] => Ok(Self::HasRaw { path: path.clone(), text: text.clone() }), + _ => Err(wrong_arity("2")), + }, + "matches" => match args { + [path, xpath, pattern] => Ok(Self::Matches { + path: path.clone(), + xpath: xpath.clone(), + pattern: parse_regex(pattern, source.clone(), dcx)?, + }), + _ => Err(wrong_arity("3")), + }, + "matchesraw" => match args { + [path, pattern] => Ok(Self::MatchesRaw { + path: path.clone(), + pattern: parse_regex(pattern, source.clone(), dcx)?, + }), + _ => Err(wrong_arity("2")), + }, + "files" => match args { + [path, files] => Ok(Self::Files { path: path.clone(), files: files.clone() }), + _ => Err(wrong_arity("2")), + }, + "count" => match args { + [path, xpath, count] => Ok(Self::Count { + path: path.clone(), + xpath: xpath.clone(), + text: None, + count: parse_count(count, source.clone(), dcx)?, + }), + [path, xpath, text, count] => Ok(Self::Count { + path: path.clone(), + xpath: xpath.clone(), + text: Some(text.clone()), + count: parse_count(count, source.clone(), dcx)?, + }), + _ => Err(wrong_arity("3 or 4")), + }, + "snapshot" => match args { + [name, path, xpath] => Ok(Self::Snapshot { + name: name.clone(), + path: path.clone(), + xpath: xpath.clone(), + }), + _ => Err(wrong_arity("3")), + }, + "has-dir" => match args { + [path] => Ok(Self::HasDir { path: path.clone() }), + _ => Err(wrong_arity("1")), + }, + _ => { + // FIXME: Suggest potential typo candidates. + // FIXME: Suggest "escaping" via non-whitespace char like backslash + // FIXME: Note that it's parsed as a HtmlDocCk command, not as a ui_test-style compiletest directive + dcx.emit( + &format!("unrecognized command `{}`", name.as_str()), + Source { range: name.range(), ..source }, + None, + ); + Err(()) + } + } + } +} + +fn parse_regex(pattern: &str, source: Source<'_>, dcx: &mut DiagCtxt) -> Result { + let pattern = channel::instantiate(&pattern, dcx)?; + regex::RegexBuilder::new(&pattern).unicode(true).build().map_err(|_error| { + // FIXME: better error message and location + // FIXME: Use `regex_syntax` directly. Its error type exposes the + // underlying span which we can then translate/offset. + dcx.emit(&format!("malformed regex"), source, None) + }) +} + +fn parse_count(count: &str, source: Source<'_>, dcx: &mut DiagCtxt) -> Result { + count.parse().map_err(|_error| { + // FIXME: better error message & location + dcx.emit("malformed count", source, None); + }) +} + +fn command_regex() -> &'static Regex { + // FIXME: Use `LazyLock` here instead once it's stable on beta. + static PATTERN: OnceLock = OnceLock::new(); + PATTERN.get_or_init(|| { + use group::*; + + regex::RegexBuilder::new(&format!( + r#" + \s(?P<{NEGATION_MISPLACED}>!)?@(?P<{NEGATION}>!)? + (?P<{NAME}>[A-Za-z]+(?:-[A-Za-z]+)*) + (?P<{ARGUMENTS}>.*)$ + "# + )) + .ignore_whitespace(true) + .unicode(true) + .build() + .unwrap() + }) +} + +/// Regular expression capture groups. +mod group { + pub(super) const ARGUMENTS: &str = "args"; + pub(super) const NAME: &str = "name"; + pub(super) const NEGATION_MISPLACED: &str = "prebang"; + pub(super) const NEGATION: &str = "postbang"; +} diff --git a/triagebot.toml b/triagebot.toml index 7c58402b737b7..c40acd2449427 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -156,7 +156,7 @@ trigger_files = [ "tests/rustdoc-json", # Internal tooling - "src/etc/htmldocck.py", + "src/tools/htmldocck", "src/tools/jsondocck", "src/tools/jsondoclint", "src/tools/rustdoc-gui",